From 4de6b859796e6c18ce40f7776fd46437f376b33b Mon Sep 17 00:00:00 2001 From: "Yogesh (OpenERP)" Date: Wed, 5 Oct 2011 12:21:55 +0530 Subject: [PATCH] [FIX] fix problem of poperty filed. if property field have a default value then check the id. bzr revid: ysa@tinyerp.com-20111005065155-nfwersyv05ddjq40 --- openerp/osv/fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 47052d0797a..dc6a05b5925 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -525,7 +525,7 @@ class many2many(_column): _type = 'many2many' def __init__(self, obj, rel=None, id1=None, id2=None, string='unknown', limit=None, **args): - """ + """ """ _column.__init__(self, string=string, **args) self._obj = obj @@ -539,7 +539,7 @@ class many2many(_column): def _sql_names(self, source_model): """Return the SQL names defining the structure of the m2m relationship table - + :return: (m2m_table, local_col, dest_col) where m2m_table is the table name, local_col is the name of the column holding the current model's FK, and dest_col is the name of the column holding the destination model's FK, and @@ -1216,7 +1216,7 @@ class property(function): default_val = self._get_default(obj, cr, uid, prop_name, context) property_create = False - if hasattr(default_val, '_id'): + if hasattr(default_val, '_id') and default_val: if default_val._id != id_val: property_create = True elif id_val != default_val: