[FIX] account: manual skip REMOVE commande as not supported by resolve_o2m_commands_t...
authorXavier ALT <xal@openerp.com>
Fri, 1 Mar 2013 09:01:02 +0000 (10:01 +0100)
committerXavier ALT <xal@openerp.com>
Fri, 1 Mar 2013 09:01:02 +0000 (10:01 +0100)
bzr revid: xal@openerp.com-20130301090102-jkz4uu4jitn2r34y

addons/account/account.py

index 63e9a78..f9b1ff3 100644 (file)
@@ -1367,9 +1367,7 @@ class account_move(osv.osv):
 
     def onchange_line_id(self, cr, uid, ids, line_ids, context=None):
         balance = 0.0
-        for line_id in line_ids:
-            if line_id[0] == 2 :
-                return {}
+        line_ids = [ line for line in line_ids if not (isinstance(line, (tuple, list)) and line and line[0] == 2) ]
         line_ids = self.resolve_o2m_commands_to_record_dicts(cr, uid, 'line_id', line_ids, context=context)
         for line in line_ids:
             balance += (line['debit'] or 0.00)- (line['credit'] or 0.00)