Reviewers: ,


Please review this at http://codereview.tryton.org/131001/

Affected files:
  M invoice.py


Index: invoice.py
===================================================================
--- a/invoice.py
+++ b/invoice.py
@@ -35,7 +35,15 @@

 class InvoiceLine(ModelSQL, ModelView):
     _name = 'account.invoice.line'
-
+
+    def write(self, ids, vals):
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        if vals.has_key('invoice') and vals['invoice'] == -1:
+            del vals['invoice']
+        self.check_modify(ids)
+        return super(InvoiceLine, self).write(ids, vals)
+
     def _view_look_dom_arch(self, tree, type, field_children=None):
         if type == 'form' and Transaction().context.get('standalone'):
             tree_root = tree.getroottree().getroot()


--
[email protected] mailing list

Reply via email to