Hi,

I was requested to provide a plan for multi-company as I say in
issue3974 [1].

TL;DR: drop record rule, add domain on fields

First, what is wrong with the current implementation? The multi-company
is a legacy from TinyERP/OpenERP/Odoo (partially from me). It uses the
record rule to split the records by companies and many part of the code
rely on this to find the right subset of records etc.
It is a wrong design because it is mixing 2 things, the access right and
the business logic. There are no reason to rely on access right to
ensure that an sale generate invoices from the same company.

So the plan is to remove all the company record rule/access right (it is
part of the customization/configuration) and use domains to enforce
company where it is needed (invoices on sale, account on moves, etc.)
So by default everyone will see every companies, restriction will be
part of the configuration.
And the company context will be used only for default value of company
field.
It will probably require to add some more 'company' fields, for example
on move. They will be needed on «main documents» and thanks to the
domain inversion and the validation, children lines will be filled
correctly and the integrity will be respected.

The only tricky part that I see for this change, is the stock quantity
computation. But probably we could just add a filter for companies.

Also this change will not affect any mono-company installation which I
guess is the majority.


[1] https://bugs.tryton.org/issue3974
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgplqopR6o6jq.pgp
Description: PGP signature

Reply via email to