Support mixed invoice type by line in invoiced quantity calculation
issue4410 review10751002
This commit is contained in:
1 parent
e2dded4c98
commit
0cf4a7af79
2 files changed
+10
-1
No files matched your search
@@ -1,5 +1,7 @@
|
||||
* Use TaxableMixin
|
||||
|
||||
* Support mixed invoice type by line in invoiced quantity calculation
|
||||
|
||||
Version 3.4.0 - 2014-10-20
|
||||
* Bug fixes (see mercurial logs for details)
|
||||
* Confirmed state split into Confirmed and Processing
|
||||
|
||||
+8
-1
@@ -1227,8 +1227,15 @@ class PurchaseLine(ModelSQL, ModelView):
|
||||
if old_invoice_line.type != 'line':
|
||||
continue
|
||||
if old_invoice_line.id not in skip_ids:
|
||||
if old_invoice_line.invoice:
|
||||
old_invoice_type = old_invoice_line.invoice.type
|
||||
else:
|
||||
old_invoice_type = old_invoice_line.invoice_type
|
||||
|
||||
sign = 1 if old_invoice_type == invoice_type else -1
|
||||
|
||||
quantity -= Uom.compute_qty(old_invoice_line.unit,
|
||||
old_invoice_line.quantity, self.unit)
|
||||
sign * old_invoice_line.quantity, self.unit)
|
||||
|
||||
rounding = self.unit.rounding if self.unit else 0.01
|
||||
invoice_line.quantity = Uom.round(quantity, rounding)
|
||||
|
||||
Reference in new issue
Block a user