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 -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -