Intermediate method needed if we create another object
The Problem : If we create one module 'xyz' which will add one new field 'abc' in account.invoice. I also add another field 'def' in account.move which is same as invoice's 'abc' field. Now when i create Invoice i gave some value to 'abc'. When i press 'Create Invoice' it create account.move from Invoice and put that move reference in Invoice. If i want to set same value for 'def' as i have for 'abc' in invoice then what i have to do is, I have to override the 'action_
The Solution : If we create any object from any other object then add one intermidiate method which return dict which dict we can use to update the dict of new object which is goint to create. This thing is done in Sales Order. I am including that method.
For example :
We are creating Invoice from Sales Order with '_make_invoice' method so there is another method '_inv_get' which return dict and that dict is update in created invoice dict
so if we want to add any value of fields from Sale Order to Invoice then we have to override only this '_inv_get' method and just return dict with this value like if we want to set 'abc' fields value of Sales Order to 'def' then we have to return dict as
This will set 'def' value as same as 'abc' in Sales Order
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Husen Daudi
- Direction:
- Needs approval
- Assignee:
- Jay Vora (Serpent Consulting Services)
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by