The function "Write" after new o2m record don't update form and don't be saved
class A(osv.osv):
_name="A"
def write(self, cr, uid, ids, vals, context=None):
eval = vals.get('b_ids', 0)
for item in eval:
return super(A, self).write(cr, uid, ids, vals, context)
_columns={
"name": fields.char('Name', size=25 ),
"b_ids": fields.
"state_a": fields.
}
A()
class B(osv.osv):
_name='B'
_columns={
"name": fields.char('Name', size=25 ),
"a_id": fields.
"state_b": fields.
}
_defaults = {
'a_id': lambda self, cr, uid, context: context.get('a', False),
}
B()
-In the form of the A object i have a o2m grid with its B objects.
-Now i create a new B object from the grid.
-The write function of the A object is called and the new value of "state" is stored in the database but not displayed in the form.
-If i press the cancel button of the form the new value of the "state" field is displayed but if i press the save button the new value is deleted from the database and not displayed in the saved form.
This behavior does not happen in the GTK client.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
This question was originally filed as bug #656747.
Can you help with this problem?
Provide an answer of your own, or ask David Diz for more information if necessary.