OCA / l10n-brazil

Localização brasileira oficial do Odoo.
https://odoo-community.org/psc-teams/brazil-66
GNU Affero General Public License v3.0
241 stars 244 forks source link

[14.0][spec_driven_model][FIX] fix MRO + auto access #3215

Closed rvalyi closed 3 months ago

rvalyi commented 3 months ago

backport from v15 #2874

The reason to look if there is a name in [underline_name, user_access_name] is because in v14 I used the same underline_name both for user and manager access record names. This was bad but doing this test we ensure it won't create new records.

As for new databases it now looks like:

> select * from ir_model_access where name ilike '%nfe_40_det%';

 id  |                name                | active | model_id | group_id | perm_read | perm_write | perm_create | perm_unlink | create_uid |        create_date        | write_uid |         write_date
-----+------------------------------------+--------+----------+----------+-----------+------------+-------------+-------------+------------+---------------------------+-----------+----------------------------
 413 | access_nfe_40_detpag_user          | t      |      208 |       22 | t         | f          | f           | f           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 414 | access_nfe_40_detpag_manager       | t      |      208 |       23 | t         | t          | t           | t           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 489 | access_nfe_40_detexport_user       | t      |      159 |       22 | t         | f          | f           | f           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 490 | access_nfe_40_detexport_manager    | t      |      159 |       23 | t         | t          | t           | t           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 411 | access_nfe_40_det_obsfisco_user    | t      |      194 |       22 | t         | f          | f           | f           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 412 | access_nfe_40_det_obsfisco_manager | t      |      194 |       23 | t         | t          | t           | t           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 483 | access_nfe_40_det_obscont_user     | t      |      193 |       22 | t         | f          | f           | f           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
 484 | access_nfe_40_det_obscont_manager  | t      |      193 |       23 | t         | t          | t           | t           |          1 | 2024-07-24 06:37:57.02618 |         1 | 2024-07-24 07:37:48.266777
(8 rows)
rvalyi commented 3 months ago

/ocabot merge minor

OCA-git-bot commented 3 months ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 14.0-ocabot-merge-pr-3215-by-rvalyi-bump-minor, awaiting test results.

OCA-git-bot commented 3 months ago

Congratulations, your PR was merged at f3f3959bce4e7c9a887d12a9f804edb5bc2ec877. Thanks a lot for contributing to OCA. ❤️