← Back to team overview

openobject-italia-core-devs team mailing list archive

[Merge] lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati into lp:openobject-italia/7.0

 

Lorenzo Battistini - Agile BG has proposed merging lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati into lp:openobject-italia/7.0.

Requested reviews:
  OpenERP Italia core devs (openobject-italia-core-devs)
Related bugs:
  Bug #1221567 in OpenERP Italia: "[7.0][6.1] l10n_it_vat_registries Gli importi dei corrispettivi se gestiti mediante causali non sono corretti"
  https://bugs.launchpad.net/openobject-italia/+bug/1221567

For more details, see:
https://code.launchpad.net/~agilebg/openobject-italia/7.0-bug-1221567-elbati/+merge/184509
-- 
https://code.launchpad.net/~agilebg/openobject-italia/7.0-bug-1221567-elbati/+merge/184509
Your team OpenERP Italia core devs is requested to review the proposed merge of lp:~agilebg/openobject-italia/7.0-bug-1221567-elbati into lp:openobject-italia/7.0.
=== modified file 'l10n_it_vat_registries/invoice.py'
--- l10n_it_vat_registries/invoice.py	2013-08-21 16:15:06 +0000
+++ l10n_it_vat_registries/invoice.py	2013-09-09 07:18:23 +0000
@@ -68,12 +68,18 @@
 
     def _get_invoice_total(self, move):
         total = 0.0
+        receivable_payable_found = False
         for move_line in move.line_id:
             if move_line.account_id.type == 'receivable':
                 total += move_line.debit or ( - move_line.credit)
+                receivable_payable_found = True
             elif move_line.account_id.type == 'payable':
                 total += ( - move_line.debit) or move_line.credit
-        return abs(total)
+                receivable_payable_found = True
+        if not receivable_payable_found:
+            return abs(move.amount)
+        else:
+            return abs(total)
     
     def build_parent_tax_codes(self, tax_code):
         res={}


Follow ups