Merge branch 'master-account-discount' into 'master'

Improve code of prepare invoice vals and increase width of div

See merge request flectra-hq/flectra!86
This commit is contained in:
Parthiv Patel 2018-06-26 10:33:29 +00:00
commit db6cd01722
2 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<xpath expr="//div/div[hasclass('clearfix')]" position="replace">
<div class="clearfix">
<div id="total" class="row">
<div class="col-xs-4 pull-right">
<div class="col-xs-5 pull-right">
<table class="table table-condensed" style="min-width: 250px;max-width: 400px;">
<tr>
<td><strong>Gross Amount</strong></td>

View File

@ -145,13 +145,11 @@ class SaleOrder(models.Model):
@api.multi
def _prepare_invoice(self):
sale_order = self.env['sale.order'].browse(
self._context.get('active_ids', []))
invoice_vals = super(SaleOrder, self)._prepare_invoice()
invoice_vals.update({
'discount_method': sale_order.discount_method,
'discount_amount': sale_order.discount_amount,
'discount_per': sale_order.discount_per,
'discount': sale_order.discount,
'discount_method': self.discount_method,
'discount_amount': self.discount_amount,
'discount_per': self.discount_per,
'discount': self.discount,
})
return invoice_vals