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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -