I have a problem when i update field1 with the vale of field2 from button in the same form
<field name="field1" />
<field name="field2" />
<button name="button1" type="object" />
def button1(self, cr, uid, ids, context=None):
...
return self.write(cr, uid, ids, {'field1': field2}, context=context)
_columns = {
'field1': fields.integer('Field1'),
'field2': fields.integer('Field2'),
}
field2 is an undefined variable(in python), so you need to assign the value to it by browsing the record