[FIX] account : error message when delete move line
authorPinakin Nayi (OpenERP) <pna@tinyerp.com>
Thu, 22 Nov 2012 06:14:46 +0000 (11:44 +0530)
committerPinakin Nayi (OpenERP) <pna@tinyerp.com>
Thu, 22 Nov 2012 06:14:46 +0000 (11:44 +0530)
bzr revid: pna@tinyerp.com-20121122061446-f8g2wq2vw5hhikxu

addons/account/account.py

index 46d6d17..63e9a78 100644 (file)
@@ -1367,6 +1367,9 @@ 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 = 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)