Hi all odoo developer, I would like to ask that :
- 1-/ First I have two module my module and sale module
- 2-/ When I create data in my module , I want to auto create data in sale module too
How many ways I can do this task ? Plz guide me
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi all odoo developer, I would like to ask that :
- 1-/ First I have two module my module and sale module
- 2-/ When I create data in my module , I want to auto create data in sale module too
How many ways I can do this task ? Plz guide me
On your Module you inherit create function as the following:
and before applying the event (create event) you call your custom method which you used to create in the other module
@api.model
def create(self, vals):
self.create_otherModule_data()
res = super(Guest, self).create(vals)
return res
def create_otherModule_data(self):
line_dic = {
'name': name,
'complete_name': self.complete_name,
'code': code,
'active': True,
}
self.env['module.modelname'].create(line_dic)
I Hope this answer help you
you are welcome
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
You just need to override Odoo's Create Function: https://goo.gl/4BkizH