Add context['company'] in CompanyValueMixin

Checking multi-company fields in the parties, I see that, whenever the CompanyValueMixin is set, the “company” is added to the context through the setup and I don’t quite understand why it is necessary.

An example would be the “” model. modules/company: 24f16c00a4c5 :

    def __setup__(cls):
        super().__setup__()['company'] = Eval('company', -1) # <-- 
        if 'company' not in

This is required to force the context value of each record to the current value of the company field in the Mixin table. For example, if you have the same party in two companies with this clause the tryton ORM will browse each party with the right company in the context.

You can see the full explanation in the related issue.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.