Odoo Help


1 Answer

Akhil P Sivan India

--Akhil P Sivan--

| 6 5 9
Kochi, India
--Akhil P Sivan--

Odoo Developer

email-id : akhilpsivan01@gmail.com

Akhil P Sivan India
9/2/15, 8:00 AM

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')

def _compute_upper(self):
for rec in self:
self.upper = self.name.upper() if self.name else False

def _inverse_upper(self):
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.

Emipro, Hardik Patadia United States
9/2/15, 8:18 AM

Thank you Akhil..

Akhil P Sivan India
9/2/15, 9:40 AM

Did you solve the problem Hardik?

Mostafa Abd El Fattah Egypt
8/22/16, 7:59 AM

Hey Akhil i have another case which i need to execute the computed field each time there is an update in odoo field in setting another model without relation

Ask a Question
Keep Informed
1 follower(s)
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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now