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

Fix bug: account group_show_line_subtotals_tax_included / excluded #2487 #2489

Merged
merged 1 commit into from Dec 30, 2020

Conversation

estraka
Copy link

@estraka estraka commented Dec 28, 2020

Description of the issue/feature this PR addresses:

When a migration is executed and the system and users are confirmed to show prices including taxes, the process fails due to validation:
Constraint in V13 : https://github.com/odoo/odoo/blob/13.0/addons/account/models/res_users.py#L13

Origin of the fault
no_update.xml file in OpenUpgrade : https://github.com/OCA/OpenUpgrade/blob/13.0/addons/account/migrations/13.0.1.1/noupdate_changes.xml#L41https://github.com/OCA/OpenUpgrade/blob/13.0/addons/account/migrations/13.0.1.1/post-migration.py#L1024

Current behavior before PR:

To fix the problem in a generic way, I remove the membership of account.group_show_line_subtotals_tax_included for the users member of base.group_user, then call this function before that call and delete the relationship between account.group_show_line_subtotals_tax_included and base.group_user in res_groups_implied_rel table because new relationship between base.group_user and account.group_show_line_subtotals_tax_excluded will be created in noupdate_changes.xml file.

Desired behavior after PR is merged:

The process of migration not fails.

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

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the simplest solution is to not change groups for base user commenting this line:

<field name="implied_ids" eval="[(4, ref('account.group_show_line_subtotals_tax_excluded'))]"/>

@@ -996,6 +996,42 @@ def assign_account_tags_to_move_lines(env):
)


def fill_invoice_ids(env):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you doing this unrelated change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an error. I saw it on github ... but I didn't realize that I had added it, I thought that I would have put some space in front of the def and it would detect it as a change ... I absolutely did not remember having put them, I would make a mistake in a: " CTRL + V "The truth is that I am new to the whole process (python, odoo, git, github ...) and I am struggling to adapt ...
Apologies for my mistake.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. These things happen. Just amend it and go on.

@pedrobaeza pedrobaeza added this to the 13.0 milestone Dec 30, 2020
@pedrobaeza pedrobaeza merged commit 80a6e24 into OCA:13.0 Dec 30, 2020
@StefanRijnhart
Copy link
Member

Thanks for the fix! This bit of noupdate data is not new in 13 (https://github.com/odoo/odoo/blob/12.0/addons/account/security/account_security.xml#L83-L84) and should not be force-loaded here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants