Hi all,
i'm new in odoo and python programming. i have a situation. i want to update all record in a table. here's my code
def button_posting(self):
self.write({'state':'active'})
return True
that code only update one record. from 'draft' to 'active' in state field.
when i clicked a 'Posting' button, i want update all record to 'draft' and only one record become 'active'
how can i do that..?
thanks before.
PS: i'm sorry for my terrible english.. :)
i got this error:
here is my code:
@api.multi
def button_posting(self):
self.search(['id', '!=', self.id]).write({'state':'draft'})
self.write({'state':'active'})
return True
what should i do? i use win 10
thanks.
Solve it?