Question about computed and default fields. In company_dependent context.
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?