Re: [tryton-dev] Toward a working multi-company
On 08 Sep 10:05, Cédric Krier wrote: > On 24 Jul 11:08, Cédric Krier wrote: > > On 24 Jul 01:13, Cédric Krier wrote: > > > On 24 Jul 00:53, Mathias Behrle wrote: > > > > * Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" > > > > (Wed, 23 Jul > > > > 2014 22:54:04 +0200): > > > > > > > > > On 03 Jul 09:59, Cédric Krier wrote: > > > > > > 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 > > > > > > > > > > Here is > > > > > > > > > > - the issue: https://bugs.tryton.org/issue4080 > > > > > - the review: http://codereview.tryton.org/10461002/ > > > > > > > > Much appreciated! As we are at the point to make the decision for a > > > > customer to > > > > use a multi-company in favor of a multi-database setup I want to ask, > > > > if we can > > > > supposedly rely on this feature in the future. If there are > > > > uncertainties about > > > > the persistance of this feature, please let us know. > > > > > > For me, it is the way to go but still waiting feedback from others. > > > But about "feature" as you can see it is more about removing rules than > > > adding new stuff. The new code is mainly adding missing domain (should > > > be there in any cases) or missing company field and in few places it > > > just hard code the previous rule because anything else don't make sense > > > (ex: stock quantity) > > > > Also this review needs more testing especially for new cases, like > > creating a sale for an other company then the current user one. > > For me, the state of the patch is good for inclusion so I plan to push > it by the end of the week of I get no bad feedbacks. So I give up for this patch. So to be clear, multi-company will still not work for the next release. The issues are: - property field: it will not be possible to have correct multi-company when we still have those shitty fields. - context: in base we should never depend on context. - user.company: in base we should never depend on this. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpU8Oc4EuyZH.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
* Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" (Mon, 8 Sep 2014 10:05:28 +0200): > On 24 Jul 11:08, Cédric Krier wrote: > > On 24 Jul 01:13, Cédric Krier wrote: > > > On 24 Jul 00:53, Mathias Behrle wrote: > > > > * Cédric Krier: " Re: [tryton-dev] Toward a working > > > > multi-company" (Wed, 23 Jul 2014 22:54:04 +0200): > > > > > > > > > On 03 Jul 09:59, Cédric Krier wrote: > > > > > > 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 > > > > > > > > > > Here is > > > > > > > > > > - the issue: https://bugs.tryton.org/issue4080 > > > > > - the review: http://codereview.tryton.org/10461002/ > > > > > > > > Much appreciated! As we are at the point to make the decision for a > > > > customer to use a multi-company in favor of a multi-database setup I > > > > want to ask, if we can supposedly rely on this feature in the future. > > > > If there are uncertainties about the persistance of this feature, > > > > please let us know. > > > > > > For me, it is the way to go but still waiting feedback from others. > > > But about "feature" as you can see it is more about removing rules than > > > adding new stuff. The new code is mainly adding missing domain (should > > > be there in any cases) or missing company field and in few places it > > > just hard code the previous rule because anything else don't make sense > > > (ex: stock quantity) > > > > Also this review needs more testing especially for new cases, like > > creating a sale for an other company then the current user one. > > For me, the state of the patch is good for inclusion so I plan to push > it by the end of the week of I get no bad feedbacks. The test of this patch is on my TODO, but I didn't manage so far to find the time. I will try to do it this week. -- Mathias Behrle MBSolutions Gilgenmatten 10 A D-79114 Freiburg Tel: +49(761)471023 Fax: +49(761)4770816 http://m9s.biz UStIdNr: DE 142009020 PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6 signature.asc Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
On 24 Jul 11:08, Cédric Krier wrote: > On 24 Jul 01:13, Cédric Krier wrote: > > On 24 Jul 00:53, Mathias Behrle wrote: > > > * Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" (Wed, > > > 23 Jul > > > 2014 22:54:04 +0200): > > > > > > > On 03 Jul 09:59, Cédric Krier wrote: > > > > > 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 > > > > > > > > Here is > > > > > > > > - the issue: https://bugs.tryton.org/issue4080 > > > > - the review: http://codereview.tryton.org/10461002/ > > > > > > Much appreciated! As we are at the point to make the decision for a > > > customer to > > > use a multi-company in favor of a multi-database setup I want to ask, if > > > we can > > > supposedly rely on this feature in the future. If there are uncertainties > > > about > > > the persistance of this feature, please let us know. > > > > For me, it is the way to go but still waiting feedback from others. > > But about "feature" as you can see it is more about removing rules than > > adding new stuff. The new code is mainly adding missing domain (should > > be there in any cases) or missing company field and in few places it > > just hard code the previous rule because anything else don't make sense > > (ex: stock quantity) > > Also this review needs more testing especially for new cases, like > creating a sale for an other company then the current user one. For me, the state of the patch is good for inclusion so I plan to push it by the end of the week of I get no bad feedbacks. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpPqmT6hO4gd.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
On 26 Jul 00:55, Albert Cervera i Areny wrote: > > 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. > > I'm not sure this is the desired behaviour nor consistent with how > Tryton currently works. For example, to me it looks quite similar to > the warehouse field in sales. There, the warehouse is only filled in > automatically if the user has access to one warehouse only. > > Well, maybe some users will desire this behaviour but I think it is an > error-prone default. I don't understand. > > 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. > > I agree the filter is the way to go. > > I took a look at the patch and I see that by now you used user's > default company. I really prefer the filter. I keep the current behavior for cases that needs something. If you have a better design please propose a patch. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpnrq23e93GM.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
2014-07-03 9:59 GMT+02:00 Cédric Krier : > 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. I agree current design is wrong. > 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. I'm not sure this is the desired behaviour nor consistent with how Tryton currently works. For example, to me it looks quite similar to the warehouse field in sales. There, the warehouse is only filled in automatically if the user has access to one warehouse only. Well, maybe some users will desire this behaviour but I think it is an error-prone default. > 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. I agree the filter is the way to go. I took a look at the patch and I see that by now you used user's default company. I really prefer the filter. > > 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/ -- Albert Cervera i Areny Tel. 93 553 18 03 @albertnan www.NaN-tic.com
Re: [tryton-dev] Toward a working multi-company
On 24 Jul 01:13, Cédric Krier wrote: > On 24 Jul 00:53, Mathias Behrle wrote: > > * Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" (Wed, 23 > > Jul > > 2014 22:54:04 +0200): > > > > > On 03 Jul 09:59, Cédric Krier wrote: > > > > 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 > > > > > > Here is > > > > > > - the issue: https://bugs.tryton.org/issue4080 > > > - the review: http://codereview.tryton.org/10461002/ > > > > Much appreciated! As we are at the point to make the decision for a > > customer to > > use a multi-company in favor of a multi-database setup I want to ask, if we > > can > > supposedly rely on this feature in the future. If there are uncertainties > > about > > the persistance of this feature, please let us know. > > For me, it is the way to go but still waiting feedback from others. > But about "feature" as you can see it is more about removing rules than > adding new stuff. The new code is mainly adding missing domain (should > be there in any cases) or missing company field and in few places it > just hard code the previous rule because anything else don't make sense > (ex: stock quantity) Also this review needs more testing especially for new cases, like creating a sale for an other company then the current user one. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpUnVyhrCef5.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
On 24 Jul 00:53, Mathias Behrle wrote: > * Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" (Wed, 23 > Jul > 2014 22:54:04 +0200): > > > On 03 Jul 09:59, Cédric Krier wrote: > > > 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 > > > > Here is > > > > - the issue: https://bugs.tryton.org/issue4080 > > - the review: http://codereview.tryton.org/10461002/ > > Much appreciated! As we are at the point to make the decision for a customer > to > use a multi-company in favor of a multi-database setup I want to ask, if we > can > supposedly rely on this feature in the future. If there are uncertainties > about > the persistance of this feature, please let us know. For me, it is the way to go but still waiting feedback from others. But about "feature" as you can see it is more about removing rules than adding new stuff. The new code is mainly adding missing domain (should be there in any cases) or missing company field and in few places it just hard code the previous rule because anything else don't make sense (ex: stock quantity) > BTW the current multi-company support wrt. to shared models would work quite > well for this use case. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpnEPzyGqpNO.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
* Cédric Krier: " Re: [tryton-dev] Toward a working multi-company" (Wed, 23 Jul 2014 22:54:04 +0200): > On 03 Jul 09:59, Cédric Krier wrote: > > 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 > > Here is > > - the issue: https://bugs.tryton.org/issue4080 > - the review: http://codereview.tryton.org/10461002/ Much appreciated! As we are at the point to make the decision for a customer to use a multi-company in favor of a multi-database setup I want to ask, if we can supposedly rely on this feature in the future. If there are uncertainties about the persistance of this feature, please let us know. BTW the current multi-company support wrt. to shared models would work quite well for this use case. -- Mathias Behrle MBSolutions Gilgenmatten 10 A D-79114 Freiburg Tel: +49(761)471023 Fax: +49(761)4770816 http://m9s.biz UStIdNr: DE 142009020 PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6 signature.asc Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
On 03 Jul 09:59, Cédric Krier wrote: > 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 Here is - the issue: https://bugs.tryton.org/issue4080 - the review: http://codereview.tryton.org/10461002/ -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpxE_wFFkCz8.pgp Description: PGP signature
Re: [tryton-dev] Toward a working multi-company
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
Re: [tryton-dev] Toward a working multi-company
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? 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? 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? -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk
[tryton-dev] Toward a working multi-company
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/ pgplqopR6o6jq.pgp Description: PGP signature