-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
13 account chart refactor update taxes #1056
13 account chart refactor update taxes #1056
Conversation
I encountered a situation where I needed to sync some tax objects from the templates but some account settings on the repartition lines were customised and should be preserved. While implementing & testing this enhancement I came accross a whole set of issues in the tax update logic:
In order to fix it, I implemented logic based upon the approach in account/models/chart_template.py for tags and deferred account settings. This PR also makes it clear that we should more unit tests to this module. |
The test failed on travis (not on a local install) because the admin users if part of the Adviser group. Make sure we have the right group and add a test for that feature too.
- Change in journal the existing 'Lock date' by two dates, the same as in company. - Add a wizard to allows a massive update of those dates for several journals at the same time.
Hey @luc-demeyer I have been testing. Imagine in v12 you have a bill and put a tax (that have tax children) in a line. Then when migrating to v13, suppose new tax repartition lines are generated for each tax without tax children and the journal items are updated to point to those tax repartition lines. But happens in v13 that some localizations (ie, l10n_es) have substituted those old taxes with tax children for taxes with multiple tax repartition lines. I expected that running this module tool of update chart template after migration, I could adapt to the new localization taxes. But what I found was the following: in the journal items (move lines) the tax_repartition_line_id field is not updated. I mean, the tax repartition lines generated in the migration for tax children are still there but inactive. But those linked tax repartition lines should have been substituted for the new multiple repartition lines of their substituting taxes. It surprises me to see that the tax_ids field is correctly updated with new taxes but not the tax_repartition_line_id field. I hope I explained the problem and could you test what I am saying. Let me know if I can help with anything. |
@MiquelRForgeFlow We could add a wizard doing this to this module but I think we should make a new module for that (I'll do this exercise next month for a couple of customer projects hence we may use this experience as a starting point for such an OCA module). |
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: account-financial-tools-13.0/account-financial-tools-13.0-account_journal_lock_date Translate-URL: https://translation.odoo-community.org/projects/account-financial-tools-13-0/account-financial-tools-13-0-account_journal_lock_date/
@luc-demeyer In the method diff_fields, it can break in |
@luc-demeyer I made a PR to your branch here luc-demeyer#14 |
@MiquelRForgeFlow |
@luc-demeyer for example, having a custom module that defines a new field for account.tax.template but not in the account.tax model. Then, if you don't have "expected", then breaks in the second "if". BTW, if you look the code in previous versions like v12, you will see that the "try except" solution was already implemented. |
@MiquelRForgeFlow |
I don't think it can be limited more. See in https://github.com/OCA/account-financial-tools/blob/12.0/account_chart_update/wizard/wizard_chart_update.py#L604L621, that's the same group of lines affected.
Use case: OCA/l10n-spain#1443 |
@luc-demeyer cold you rebase? first commit is already in branch 13.0 |
@MiquelRForgeFlow |
This branch is not clean. Please rebase properly and let the specific commits. |
@luc-demeyer |
Superseded by #1251 |
No description provided.