Odoo Help

1

Question about computed and default fields. In company_dependent context.

By
Dimitar Epitropov
on 11/1/17, 7:54 AM 630 views

I am looking at the company_depended property and how it works. I am looking at the definitions of it's computed fields:

def _default_company_dependent(self, model):
return model.env['ir.property'].get(self.name, self.model_name)

def _compute_company_dependent(self, records):
Property = records.env['ir.property']
values = Property.get_multi(self.name, self.model_name, records.ids)
for record in records:
record[self.name] = values.get(record.id)


I am really struggling to understand how model and records are passed as arguments to those methods. Basically the definition of computed includes only self without records. So how does that work?

Thanks,
Dimitar





0
ALEXANDRU RAILEANU
On 11/29/17, 5:41 AM

I am also interested in the answer for your question :)

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

Question tools

1 follower(s)

Stats

Asked: 11/1/17, 7:54 AM
Seen: 630 times
Last updated: 5/4/18, 2:36 AM