[FIX] ir.model filter out link that occurs when using the ir.model web form view
authorAntony Lesuisse <al@openerp.com>
Wed, 8 Feb 2012 22:17:06 +0000 (23:17 +0100)
committerAntony Lesuisse <al@openerp.com>
Wed, 8 Feb 2012 22:17:06 +0000 (23:17 +0100)
lp bug: https://launchpad.net/bugs/912769 fixed

bzr revid: al@openerp.com-20120208221706-o45t6h3zgmz3ezny

openerp/addons/base/ir/ir_model.py

index 2f05bfc..d8a0d87 100644 (file)
@@ -146,6 +146,10 @@ class ir_model(osv.osv):
     def write(self, cr, user, ids, vals, context=None):
         if context:
             context.pop('__last_update', None)
+        # Filter out operations 4 link from field id, because openerp-web
+        # always write (4,id,False) even for non dirty items
+        if 'field_id' in vals:
+            vals['field_id'] = [op for op in vals['field_id'] if op[0] != 4]
         return super(ir_model,self).write(cr, user, ids, vals, context)
 
     def create(self, cr, user, vals, context=None):