summaryrefslogtreecommitdiff
path: root/odoo/addons/base/tests/test_user_has_group.py
AgeCommit message (Collapse)Author
2019-09-24[MERGE] forward port branch saas-12.4 up to 9ed4872ea03Christophe Simonis
closes odoo/odoo#37372 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24[MERGE] forward port branch saas-12.3 up to bd3e510edbcChristophe Simonis
closes odoo/odoo#37314 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-19[FIX] base: fix portal rights updateNans Lefebvre
Commit c3717f3018 added a (5, 0, 0) command when modifying groups_id of any non-internal user, to avoid the situation where the various implications would end up giving the portal user group_user rights. This risk is avoided by commit f206714af08, which added a constraint check_one_user_type, which would raise in that specific case. The last missing piece was 9badedcd98f; when groups are added through settings, they are added through the implied_groups of the group model. The (5,) command has the unfortunate side-effect to remove the portal group from a user if a write is triggered programmatically. If that happens, then the 'signing up' process end-destination is a 500 error. Now we simplify the logic that keeping the same behaviour for implied_ids for internal (group_user) and non-internal users. We keep the (5,) command in one case: if a user is demoted to portal or public, he may have groups should be reserved to internal users, but that do not imply group_user (which would raise). To avoid that, we remove all its groups, since there is no clear distinction between technical display groups and actual privilege-granting groups. opw 2041606 closes odoo/odoo#37144 X-original-commit: 29723e351d5dc5e5ea055c80da86f4e871909de9 Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-17[MERGE] forward port branch saas-12.3 up to d8ce75466e4Christophe Simonis
2019-09-12[FIX] base: check group constraints when adding implied groupsNans Lefebvre
Since commit 5f12e244f6e, the write of implied groups is done directly in SQL, bypassing the ORM writes, and thus bypassing the python constraints checks. In particular such a constraint was added in f206714af08. We add back an explicit check of this constraint; however we rewrite it in SQL to be fast. closes odoo/odoo#35411 closes odoo/odoo#36769 Signed-off-by: Nans Lefebvre (len) <len@odoo.com> Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-09-20[MERGE] forward port branch saas-12.4 up to 4a1321bc99dChristophe Simonis
closes odoo/odoo#37127 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-04[FIX] *: sudo() -> with_user()Raphael Collet
2019-05-20[FIX] *: x2many value in testsRaphael Collet
2019-02-26[FIX] base: creation of portal userJorge Pinna Puissant
When creating a portal user from the User & Companies menu in the Settings. Before this commit, the created user had both groups' portal user and internal user, which generated an error in the display of the user accesses and rights. This also occurred if we manually add a portal user to the internal user group. Now, when creating a portal user, the user only has this group. Also, if we manually add a portal user to the internal user group, an error is raised to inform that only one user type is allowed. OPW-1929367 closes odoo/odoo#30958 Signed-off-by: "Lucas Perais (lpe)" <lpe@odoo.com>
2018-07-24[REF] models: import records in batchRaphael Collet
Create new methods on `BaseModel` to create records with given xml ids in batch. Those methods replace the methods `_update` and `_update_dummy` of model 'ir.model.data', which are now deprecated. Adapt XML and CSV import code to create records in batch.
2016-09-02[REF] openerp: move `openerp` to `odoo`Raphael Collet