Hi how to use write method in odoo 9 updates a field one form to another form updating from existing fields please explain with example
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
19026
Views
Using Active Record pattern
You can now write using Active Record pattern:
@api.one
def any_write(self):
self.x = 1
self.name = 'a'
More info about the subtility of the Active Record write pattern here https://goo.gl/2HdgUr
The classical way of writing is still available
From Record
From Record:
@api.one
...
self.write({'key': value })
# or
record.write({'key': value})
From RecordSet
From RecordSet:
@api.multi
...
self.write({'key': value })
# It will write on all record.
self.line_ids.write({'key': value })
It will write on all Records of the relation line_ids
For more detail: https://goo.gl/qGruPb
Accept and upvote answer if helpful
Thanks and Regards
Haresh Kansara
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
Aug 24
|
5504 | ||
|
4
Jul 24
|
38818 | ||
Default value in form view
Solved
|
|
5
Apr 23
|
93749 | |
|
3
Nov 22
|
2957 | ||
|
3
Aug 22
|
3040 |
Please provide the example of what you intend to do. That would be helpful for the one to give the proper answer.