Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- === modified file 'openerp/osv/orm.py'
- --- openerp/osv/orm.py 2011-07-05 12:22:22 +0000
- +++ openerp/osv/orm.py 2011-07-06 23:17:23 +0000
- @@ -2714,6 +2714,12 @@
- cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" DROP NOT NULL' % (self._table, column['attname']))
- self.__schema.debug("Table '%s': column '%s': dropped NOT NULL constraint",
- self._table, column['attname'])
- +
- + def _check_if_field_can_be_updated(self, f, context=None):
- + # Don't update custom (also called manual) fields
- + if f.manual and not context.get('update_custom_fields', False):
- + return False
- + return True
- def _auto_init(self, cr, context=None):
- """
- @@ -2739,7 +2745,6 @@
- context = {}
- store_compute = False
- todo_end = []
- - update_custom_fields = context.get('update_custom_fields', False)
- self._field_create(cr, context=context)
- create = not self._table_exist(cr)
- @@ -2767,7 +2772,7 @@
- if k in ('id', 'write_uid', 'write_date', 'create_uid', 'create_date'):
- continue
- # Don't update custom (also called manual) fields
- - if f.manual and not update_custom_fields:
- + if not self._check_if_field_can_be_updated(f, context=context):
- continue
- if isinstance(f, fields.one2many):
Add Comment
Please, Sign In to add comment