Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] l10n_de/de_reports: fix updating balance sheets #162465

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Apr 18, 2024

Forward port commit because the request is failing when we try to rename ref the tag due to the duplicate name constraint.
The implementation of forward porting has become necessary as the script attempts execution with each version, encounter failure due to the presence of the existing tag 'tag_de_liabilities_bs_B_1'. To prevent duplication, we have introduced a pre-check. If the 'B1' tag already exists, script execution is skipped.

Note: The request is failing for the 17.0 version. However, if we migrate to the version saas-16.3, it also fails. Therefore, we are creating a PR in the saas-16.3 version to forward port it for subsequent versions as well.
Upgrade request traceback group: 813

File "/home/odoo/src/odoo/17.0/addons/l10n_de/migrations/2.0/pre-migrate.py", line 45, in migrate
    rename_tag(cr, "tag_de_liabilities_bs_C_1", "tag_de_liabilities_bs_B_1")
  File "/home/odoo/src/odoo/17.0/addons/l10n_de/migrations/2.0/pre-migrate.py", line 5, in rename_tag
    cr.execute(
  File "/home/odoo/src/odoo/17.0/odoo/sql_db.py", line 332, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "ir_model_data_module_name_uniq_index"
DETAIL:  Key (module, name)=(l10n_de, tag_de_liabilities_bs_B_1) already exists.

In #126249 the german balance sheet report was updated and
during the 15.2 FW port, some issues needed fixing. The
issues and their fixes are:

  • Deleted tags: As the script didn't run, some tags (like F and all D tags) would be deleted and not renamed. As the tag might already be used as a FK in another table, we remove it from ir_model_data so it's not deleted by the ORM. Also, this means that the tags xml adds the B1 as a new tag which means renaming C1 to B1 will not work in the script due to the unique name constraint, this is handled by checking if B1 exists and if it does we do not run the script.

Enterprise PR: odoo/enterprise/pull/45899

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #161629

forward ported the commit odoo@cbefaa6

In odoo#126249 the german balance sheet report was updated and
 during the 15.2 FW port, some issues needed fixing. The
issues and their fixes are:

- Deleted tags: As the script didn't run, some tags (like F and
 all D tags) would be deleted and not renamed. As the tag might
 already be used as a FK in another table, we remove it from
 ir_model_data so it's not deleted by the ORM. Also, this means
 that the tags xml adds the B1 as a new tag which means renaming
 C1 to B1 will not work in the script due to the unique name
 constraint, this is handled by checking if B1 exists and if
 it does we do not run the script.

Enterprise PR: odoo/enterprise/pull/45899

X-original-commit: c019d6f
@robodoo
Copy link
Contributor

robodoo commented Apr 18, 2024

Pull request status dashboard.

@fw-bot
Copy link
Contributor Author

fw-bot commented Apr 18, 2024

This PR targets saas-17.1 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Apr 18, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Apr 18, 2024
robodoo pushed a commit that referenced this pull request Apr 23, 2024
forward ported the commit cbefaa6

In #126249 the german balance sheet report was updated and
 during the 15.2 FW port, some issues needed fixing. The
issues and their fixes are:

- Deleted tags: As the script didn't run, some tags (like F and
 all D tags) would be deleted and not renamed. As the tag might
 already be used as a FK in another table, we remove it from
 ir_model_data so it's not deleted by the ORM. Also, this means
 that the tags xml adds the B1 as a new tag which means renaming
 C1 to B1 will not work in the script due to the unique name
 constraint, this is handled by checking if B1 exists and if
 it does we do not run the script.

Enterprise PR: odoo/enterprise/pull/45899

closes #162465

X-original-commit: c019d6f
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
@robodoo robodoo closed this Apr 23, 2024
@fw-bot fw-bot deleted the saas-17.1-saas-16.3-forward_port_fix_de_balance_sheet-bsra-dYQZ-fw branch May 7, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants