openerp - How can I change the value of a selection field on create function? -
i wanna change value of status
once click save. status
selection field [('ok', 'ok'),('tobe', 'not ok')]
status = fields.selection( readonly=false, default='tobe', related= 'name.status' )
@api.model def create(self, values): self.status= 'ok' line = super(myclass, self).create(values) return line
status related field after create change status of many2one field.
@api.model def create(self, values): rec = super(youclassname, self).create(values) # here change status. rec.name.status = 'ok' return rec
Comments
Post a Comment