On 03 Jul 11:16, Sergi Almacellas Abellana wrote: > El 03/07/14 09:59, Cédric Krier ha escrit: > >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. > When you say restriction will be part of the configuration, you say it's up > to every company that needs to multi-company support to add the needed > access rules or another mechanims they want in order to restrict the access > to companies to some users?
Yes, they should be just like any other access rights. > >And the company context will be used only for default value of company > >field. > But the company fields on res.user will still be there? Or you plan to > remove it also? Yes - No, it is the storage of the context. > >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. > So in a multi-company environment the user will be able to compute the stock > for one company, and for all the companies in the system? Why not. But probably the wizard will ask for a company (prefilled). -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/
pgpBt1s7x42_H.pgp
Description: PGP signature