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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -