Skip to content

[18.0][IMP] account_chart_update: Visible unchecked fields by default#2196

Merged
OCA-git-bot merged 1 commit intoOCA:18.0from
moduon:imp-account_chart_update
Mar 9, 2026
Merged

[18.0][IMP] account_chart_update: Visible unchecked fields by default#2196
OCA-git-bot merged 1 commit intoOCA:18.0from
moduon:imp-account_chart_update

Conversation

@u0f
Copy link

@u0f u0f commented Dec 17, 2025

Given the old logic, ignored fields simply did not appear and were not taken into consideration. #2185

With this improve, some fields have been moved from ignored to a new method which causes them to be displayed unchecked by default.

https://www.loom.com/share/47a70d6113804757a077f0a1955722c1

@moduon MT-12947

@u0f u0f marked this pull request as draft December 17, 2025 11:18
@u0f u0f marked this pull request as ready for review December 17, 2025 11:33
Copy link
Contributor

@EmilioPascual EmilioPascual left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@yajo yajo left a comment

Choose a reason for hiding this comment

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

Code review.

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Contributor

@Shide Shide left a comment

Choose a reason for hiding this comment

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

Code review

Copy link

@Gelojr Gelojr left a comment

Choose a reason for hiding this comment

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

I do not approve the PR. Review requested.

Module configuration (change in the wizard default behavior)

Changes introduced by the PR (default wizard configuration):
For the following models, the listed fields are included in the wizard but unchecked by default:

  • account.tax.group: sequence
  • account.tax: sequence, children_tax_ids
  • account.account: root_id
  • account.group: parent_id, code_prefix_end
  • account.fiscal.position: sequence

Tests performed and results

  • TEST1 — OK

  • TEST2 — OK

  • TEST3 — NOT OK (Taxes: Sequence)

    • Starting point Image
      During the test, the Sequence field was explicitly selected in the wizard for account.tax. Image
    • However, after running the update, the tax sequence order was not updated, so the expected change was not applied. Image

Reason for requesting a review

The test performed on Taxes shows that selecting the Sequence field does not result in an actual sequence update. This behavior does not match the expected outcome and requires further review before the PR can be approved.

@u0f
Copy link
Author

u0f commented Jan 7, 2026

Reason for requesting a review

The test performed on Taxes shows that selecting the Sequence field does not result in an actual sequence update. This behavior does not match the expected outcome and requires further review before the PR can be approved.

@Gelojr I have been reviewing this with @EmilioPascual, and it is not an error. In most cases, they do not have any sequence defined by default. If you try to update one that does have a sequence in the XML file that defines it, it will be placed in its correct position.

Also, I changed the fields I unchecked by default to:

  • account.fiscal.position: sequence

@u0f u0f force-pushed the imp-account_chart_update branch 2 times, most recently from a49e557 to ec2f7aa Compare January 9, 2026 10:20
Copy link

@Gelojr Gelojr left a comment

Choose a reason for hiding this comment

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

TEST3 has been performed again. I´m agree with the change has been introduced so that the final log now explicitly lists the accounts that have not been updated because they are not part of the chart of accounts and were created by other methods.
As a possible improvement, it would be useful if the log showed not only the account name but also the account code.

Image

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link

@Gelojr Gelojr left a comment

Choose a reason for hiding this comment

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

Great job on this contribution @u0f
The following tests have been performed:

  • Test 1: Fiscal positions – verified that the field “Sequence” is not included by default when reviewing fiscal positions, and the behavior matches the expected configuration.
  • Test 2: Fiscal positions – manually selected the field “Sequence”, executed the update wizard, and confirmed that differences are correctly proposed and applied only when real discrepancies exist.

@pedrobaeza pedrobaeza changed the title [IMP] account_chart_update: Visible unchecked fields by default [18.0][IMP] account_chart_update: Visible unchecked fields by default Jan 30, 2026
@pedrobaeza pedrobaeza added this to the 18.0 milestone Jan 30, 2026
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.

Now it seems o2m fields are shown, although unchecked, while they should be forbidden explicitly, as they can't be handled properly. Example, field tax_ids in tax groups. Can you please check?

@EmilioPascual EmilioPascual force-pushed the imp-account_chart_update branch from ec2f7aa to bfc3c0d Compare February 9, 2026 06:35
@EmilioPascual
Copy link
Contributor

Now it seems o2m fields are shown, although unchecked, while they should be forbidden explicitly, as they can't be handled properly. Example, field tax_ids in tax groups. Can you please check?

Done. Thank you for your review!

@pedrobaeza
Copy link
Member

Thanks for the changes. Now I'm checking it, and it seems the changes on the tax distribution lines are not detected. Can it be affected by the o2m cleaning you have done?

EmilioPascual added a commit to moduon/account-financial-tools that referenced this pull request Feb 11, 2026
The previous implementation moved the one2many filter to _domain_per_name()
which blocked one2many fields from being added to the wizard manually.
This broke existing tests and prevented detection of changes in tax
repartition lines.

Solution: Move the one2many filter from _domain_per_name() to each
_default_*_field_ids() method. This way:
- One2many fields are NOT included by default (desired behavior)
- One2many fields CAN be added manually (needed for tests)
- Comparison in diff_fields() works correctly for nested models

Fixes issue reported by @pedrobaeza in PR OCA#2196
@EmilioPascual EmilioPascual force-pushed the imp-account_chart_update branch from 7e32ddf to 8ba16ee Compare February 11, 2026 13:52
@EmilioPascual EmilioPascual force-pushed the imp-account_chart_update branch from 8ba16ee to cfd3954 Compare February 11, 2026 15:00
@EmilioPascual
Copy link
Contributor

Thanks for the changes. Now I'm checking it, and it seems the changes on the tax distribution lines are not detected. Can it be affected by the o2m cleaning you have done?

Updated. Now distribution lines are shown but they are unchecked

@pedrobaeza
Copy link
Member

Well, they should be checked by default, as that's the most important part in the tax configuration IMO.

@EmilioPascual
Copy link
Contributor

Well, they should be checked by default, as that's the most important part in the tax configuration IMO

Now, in v18, the distribution fields are unchecked, perhaps because they are the only fields that ‘odoo reload’ updates.

image

What do you think is best? Should we leave them unchecked as before, or should they always be checked?

@pedrobaeza
Copy link
Member

If they are automatically checked and updated, no matter if the mark is checked or not, they should be hidden. If the check/update depends on the mark, then it should be checked by default.

@EmilioPascual EmilioPascual force-pushed the imp-account_chart_update branch from cfd3954 to beaa1b8 Compare March 5, 2026 09:23
@EmilioPascual
Copy link
Contributor

Done.
image

@pedrobaeza
Copy link
Member

Thanks, tested. Although there are 3 fields (invoice_repartition_line_ids, refund_repartition_line_ids and repartition_line_ids), the only one acting for putting update is the last one. If so, we may want to hide the other 2.

@EmilioPascual EmilioPascual force-pushed the imp-account_chart_update branch from beaa1b8 to b642ced Compare March 9, 2026 11:34
@EmilioPascual
Copy link
Contributor

Thanks, tested. Although there are 3 fields (invoice_repartition_line_ids, refund_repartition_line_ids and repartition_line_ids), the only one acting for putting update is the last one. If so, we may want to hide the other 2.

You're right, it's better to leave only repartition_line_ids to avoid any confusion.
Updated code.

@pedrobaeza
Copy link
Member

But they are shown, but unchecked, isn't it? I think they should be hidden as they was.

@EmilioPascual
Copy link
Contributor

But they are shown, but unchecked, isn't it? I think they should be hidden as they was.

No, they are not shown, only repartition_line_ids.

image

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.

OK, great!

/ocabot merge major

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 18.0-ocabot-merge-pr-2196-by-pedrobaeza-bump-major, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 5857c99 into OCA:18.0 Mar 9, 2026
11 checks passed
@OCA-git-bot
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants