← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~factorlibre/account-invoicing/account-invoicing-fix-merge-7.0 into lp:account-invoicing

 

Hugo Santos (Factorlibre) has proposed merging lp:~factorlibre/account-invoicing/account-invoicing-fix-merge-7.0 into lp:account-invoicing.

Requested reviews:
  Account Core Editors (account-core-editors)

For more details, see:
https://code.launchpad.net/~factorlibre/account-invoicing/account-invoicing-fix-merge-7.0/+merge/225271

UoS Maybe not defined in invoice line so is not possible to obtain the factor from there. In that case factor must be 1.0 like when assigning o_line['uom_factor']
-- 
https://code.launchpad.net/~factorlibre/account-invoicing/account-invoicing-fix-merge-7.0/+merge/225271
Your team Account Core Editors is requested to review the proposed merge of lp:~factorlibre/account-invoicing/account-invoicing-fix-merge-7.0 into lp:account-invoicing.
=== modified file 'account_invoice_merge/invoice.py'
--- account_invoice_merge/invoice.py	2014-03-19 12:17:03 +0000
+++ account_invoice_merge/invoice.py	2014-07-02 08:34:34 +0000
@@ -129,7 +129,8 @@
                 o_line = invoice_infos['invoice_line'].setdefault(line_key, {})
                 if o_line:
                     # merge the line with an existing line
-                    o_line['quantity'] += invoice_line.quantity * invoice_line.uos_id.factor / o_line['uom_factor']
+                    uos_factor = invoice_line.uos_id and invoice_line.uos_id.factor or 1.0
+                    o_line['quantity'] += invoice_line.quantity * uos_factor / o_line['uom_factor']
                 else:
                     # append a new "standalone" line
                     for field in ('quantity', 'uos_id'):


Follow ups