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 | etc.
How can I add a field to the SO table where I can check it if the SO was created by a user via the Create New SO button or if by Duplicate button from an existing PO?
Create button will trigger the ORM method "create"
similarly Duplicate Action will trigger the ORM method "copy"
So you can inherit the copy method, and append a flag (probably a boolean: set it as true) to the param "default" before returning the super call .
There are 2 methods/ways involved while duplicating a record.
"copy" : will copy the data and creates a new record, returning the ID of the newly created one.
"copy_data": will just copy the data and returns you the dict of values which are being copied.
So according to your need, use the appropriate one.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 7/18/16, 1:58 PM|
|Seen: 555 times|
|Last updated: 7/19/16, 9:22 AM|