Merge branch 'master-account-discount' into 'master'
[IMP]: issues:104:Incorrect layout for billing orders and divide by zero issues See merge request flectra-hq/flectra!143
This commit is contained in:
commit
a4ccd80351
@ -54,10 +54,11 @@ class AccountInvoice(models.Model):
|
||||
discount_value_ratio = \
|
||||
(self.discount_amount * line.price_subtotal) / \
|
||||
gross_amount
|
||||
discount_per_ratio = \
|
||||
(discount_value_ratio * 100) / line.price_subtotal
|
||||
line.write({'discount': discount_per_ratio})
|
||||
self._onchange_invoice_line_ids()
|
||||
if discount_value_ratio:
|
||||
discount_per_ratio = \
|
||||
(discount_value_ratio * 100) / line.price_subtotal
|
||||
line.write({'discount': discount_per_ratio})
|
||||
self._onchange_invoice_line_ids()
|
||||
self._check_constrains()
|
||||
|
||||
@api.multi
|
||||
|
@ -23,6 +23,7 @@
|
||||
<th t-if="display_discount" class="text-right" groups="sale.group_discount_per_so_line">Disc.(%)</th>
|
||||
<th class="text-right">Taxes</th>
|
||||
<th class="text-right">Amount</th>
|
||||
<th class="text-right">Total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="invoice_tbody">
|
||||
|
@ -54,9 +54,10 @@ class SaleOrder(models.Model):
|
||||
discount_value_ratio = \
|
||||
(self.discount_amount *
|
||||
line.price_subtotal) / gross_amount
|
||||
discount_per_ratio = \
|
||||
(discount_value_ratio * 100) / line.price_subtotal
|
||||
line.write({'discount': discount_per_ratio})
|
||||
if discount_value_ratio:
|
||||
discount_per_ratio = \
|
||||
(discount_value_ratio * 100) / line.price_subtotal
|
||||
line.write({'discount': discount_per_ratio})
|
||||
|
||||
@api.onchange('discount_method')
|
||||
def onchange_discount_method(self):
|
||||
|
Loading…
Reference in New Issue
Block a user