Hi. Im trying to make a sale.order virtually. In my code i have:
record = self.env['model'].new(data)
record.change_product()
record.compute_totals()
record.save()
Now, that last line is raising an exception. Can someone help?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi. Im trying to make a sale.order virtually. In my code i have:
record = self.env['model'].new(data)
record.change_product()
record.compute_totals()
record.save()
Now, that last line is raising an exception. Can someone help?
I cant use the create method, some of the required data are set by the onchange methods
If you want to create a new record you should use the\ create method.
Then your code shoud look like :
record = self.env['model'].create(data)
record.change_product()
record.compute_totals()
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up