Please sign in to comment.
[FIX] base, account: remove group from all users when removing settings
Adding the implied users in a group is done automatically when adding the implied_ids. Moreover it is done in SQL, bypassing record rules. Asymmetrically, the users are not removed when removing a group; it is done manually. However, since this is done via the ORM, it takes record rules into account so some users might not be visible. The standard case where this happens is multi-company. Take the case of some mutually exclusive groups, TaxB2B and TaxB2C, and a user U in company C1 and C2, in TaxB2B. In company C2, change the settings to TaxB2C. U is in another company, so U is not removed from TaxB2B. But then U is added to taxB2C, which causes a validation error. <rant> Without the validation error, the inconsistency would have been more pernicious to debug, so it's still a good thing to have it. BTW, regarding the feature, it would seem that each company should be able to decide if the Taxes should be displayed as B2B or B2C; however it's not possible to do it because it's handled by groups. If instead of removing all users we tried add/remov'ing users based on the company of the settings, it wouldn't work because users (internal and portal) can be shared between companies. So either this kind of "display groups" should be company-dependant, or the user groups should change depending on the company. But then what if the user is in 2 companies at the same time through the contextified company of version 13? </rant> opw 2118337 X-original-commit: 2c1b92f
- Loading branch information
Showing with 23 additions and 1 deletion.