Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between write and update in odoo11

What is the difference between write and update method in odoo11 because when i use write it work first time only then it not work.

like image 244
user_123 Avatar asked Mar 26 '18 10:03

user_123


1 Answers

For simple fields

  • write({'attr1': 'val1', 'attr2': 'val2'})

should give you a single update statement in the database, and

  • update({'attr1': 'val1', 'attr2': 'val2'})

iterates over the fields and sets each one separately giving you multiple update statements in the database.

like image 60
bigbear3001 Avatar answered Sep 30 '22 15:09

bigbear3001