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.
For Odoo V8
I have a field.function in product.product model, depending on two fields one from product.template say "a" and one from product.product "b", also it has got an inverse function which is having no definition, which allows me to write the value manually in the field.function field.
Now when I try to delete the value of the field "b" it calls the field.function and calculates the field but also deletes the value of field "a" (field from product.template) . I am not getting why this is happening.
Can any one guide me please
In v8, instead of fields.function, we use the compute field and @api.depends if the field depends on some other fields and that can be dotted paths when using sub-fields.
A simple example:
name = fields.Char(string="Name")
upper = fields.Char(compute='_compute_upper', inverse='_inverse_upper')
for rec in self:
self.upper = self.name.upper() if self.name else False
for rec in self:
self.name = self.upper.lower() if self.upper else False
I can help you better if you tell me what exactly you want to do, like which are the fields or paste your code.
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: 8/29/14, 8:16 AM|
|Seen: 5848 times|
|Last updated: 9/2/15, 8:01 AM|