Dear All
I have follwing scenario using Openerp 7.0:
class sometest(orm.Model)
_name = 'test.test'
_column {
'field1': fields.function(some_function, type='float', store={'some.model': (other_function, [some_trigger],10)}),
'field2': fields.function(also_function, type='float', store=True),
...
}
def _prepareSomeValues(self, cr, uid, vals, context=None):
do some stuff to prepare vals as {'record_id': float_value}
...
obj = self.pool.get('test.test)
obj._updateRecordsWithField1(cr, uid, vals, context=context)
...
return
def _updateRecordsWithField1(self, cr, uid, vals, context=None):
for record in vals:
self.write(cr, uid, [record], {'field1': vals[record],}, context=context)
return True
When trying to update field1 via the function _prepareSomeValues(), I do observe that the self.write function is called, however during processing the write it additionally calls the also_function for field2 and returns finally without updating field1, but also without any trace of an error or another problem. The inputs for the write function appear correct (record has valid object id, value of vals[record] has valid float).
How can I avoid triggering functions for field2 which I do not want to update and achieve effective writing of field1 values?
thanks in advance for any help