mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[16.0][FIX] account_chart_update: avoid fiscal position duplication when it's archived
This commit is contained in:
@@ -117,6 +117,20 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
|
|||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.
|
promote its widespread use.
|
||||||
|
|
||||||
|
.. |maintainer-yajo| image:: https://github.com/yajo.png?size=40px
|
||||||
|
:target: https://github.com/yajo
|
||||||
|
:alt: yajo
|
||||||
|
.. |maintainer-rafaelbn| image:: https://github.com/rafaelbn.png?size=40px
|
||||||
|
:target: https://github.com/rafaelbn
|
||||||
|
:alt: rafaelbn
|
||||||
|
.. |maintainer-edlopen| image:: https://github.com/edlopen.png?size=40px
|
||||||
|
:target: https://github.com/edlopen
|
||||||
|
:alt: edlopen
|
||||||
|
|
||||||
|
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
||||||
|
|
||||||
|
|maintainer-yajo| |maintainer-rafaelbn| |maintainer-edlopen|
|
||||||
|
|
||||||
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update>`_ project on GitHub.
|
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update>`_ project on GitHub.
|
||||||
|
|
||||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|||||||
@@ -8,11 +8,10 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
:Author: David Goodger (goodger@python.org)
|
:Author: David Goodger (goodger@python.org)
|
||||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||||
:Copyright: This stylesheet has been placed in the public domain.
|
:Copyright: This stylesheet has been placed in the public domain.
|
||||||
|
|
||||||
Default cascading style sheet for the HTML output of Docutils.
|
Default cascading style sheet for the HTML output of Docutils.
|
||||||
Despite the name, some widely supported CSS2 features are used.
|
|
||||||
|
|
||||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||||
customize this style sheet.
|
customize this style sheet.
|
||||||
@@ -275,7 +274,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|||||||
margin-left: 2em ;
|
margin-left: 2em ;
|
||||||
margin-right: 2em }
|
margin-right: 2em }
|
||||||
|
|
||||||
pre.code .ln { color: gray; } /* line numbers */
|
pre.code .ln { color: grey; } /* line numbers */
|
||||||
pre.code, code { background-color: #eeeeee }
|
pre.code, code { background-color: #eeeeee }
|
||||||
pre.code .comment, code .comment { color: #5C6576 }
|
pre.code .comment, code .comment { color: #5C6576 }
|
||||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||||
@@ -301,7 +300,7 @@ span.option {
|
|||||||
span.pre {
|
span.pre {
|
||||||
white-space: pre }
|
white-space: pre }
|
||||||
|
|
||||||
span.problematic, pre.problematic {
|
span.problematic {
|
||||||
color: red }
|
color: red }
|
||||||
|
|
||||||
span.section-subtitle {
|
span.section-subtitle {
|
||||||
@@ -456,12 +455,12 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
|||||||
<div class="section" id="maintainers">
|
<div class="section" id="maintainers">
|
||||||
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
|
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
|
||||||
<p>This module is maintained by the OCA.</p>
|
<p>This module is maintained by the OCA.</p>
|
||||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
|
||||||
</a>
|
|
||||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
promote its widespread use.</p>
|
||||||
|
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
|
||||||
|
<p><a class="reference external image-reference" href="https://github.com/yajo"><img alt="yajo" src="https://github.com/yajo.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/rafaelbn"><img alt="rafaelbn" src="https://github.com/rafaelbn.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/edlopen"><img alt="edlopen" src="https://github.com/edlopen.png?size=40px" /></a></p>
|
||||||
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update">OCA/account-financial-tools</a> project on GitHub.</p>
|
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/16.0/account_chart_update">OCA/account-financial-tools</a> project on GitHub.</p>
|
||||||
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -466,3 +466,33 @@ class TestAccountChartUpdate(TestAccountChartUpdateCommon):
|
|||||||
self.assertTrue(list(self.fp.get_external_id().values())[0])
|
self.assertTrue(list(self.fp.get_external_id().values())[0])
|
||||||
self.assertEqual(fp_rec.get_external_id().get(fp_id), expected_xmlid)
|
self.assertEqual(fp_rec.get_external_id().get(fp_id), expected_xmlid)
|
||||||
wizard.unlink()
|
wizard.unlink()
|
||||||
|
|
||||||
|
def test_01_archived_fiscal_position(self):
|
||||||
|
# Test wizard won't duplicate existing fiscal positions when archived
|
||||||
|
self.fp_template.tax_ids.tax_dest_id = self.tax_template.id
|
||||||
|
self.fp_template.tax_ids.tax_src_id = self.tax_template.id
|
||||||
|
fiscal_position = self.env["account.fiscal.position"].search(
|
||||||
|
[("name", "=", self.fp_template.name), ("company_id", "=", self.company.id)]
|
||||||
|
)
|
||||||
|
wizard = self.wizard_obj.create(self.wizard_vals)
|
||||||
|
wizard.action_find_records()
|
||||||
|
wizard.action_update_records()
|
||||||
|
wizard.unlink()
|
||||||
|
fiscal_position.active = False
|
||||||
|
self.assertEqual(
|
||||||
|
fiscal_position.tax_ids.tax_src_id.name, self.tax_template.name
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
fiscal_position.tax_ids.tax_dest_id.name, self.tax_template.name
|
||||||
|
)
|
||||||
|
wizard = self.wizard_obj.create(self.wizard_vals)
|
||||||
|
wizard.action_find_records()
|
||||||
|
wizard.action_update_records()
|
||||||
|
wizard.unlink()
|
||||||
|
self.assertTrue(fiscal_position.exists())
|
||||||
|
self.assertEqual(
|
||||||
|
fiscal_position.tax_ids.tax_src_id.name, self.tax_template.name
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
fiscal_position.tax_ids.tax_dest_id.name, self.tax_template.name
|
||||||
|
)
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ class WizardUpdateChartsAccounts(models.TransientModel):
|
|||||||
continue
|
continue
|
||||||
criteria = (field_name, "in", field_values)
|
criteria = (field_name, "in", field_values)
|
||||||
|
|
||||||
result = fp_model.search(
|
result = fp_model.with_context(active_test=False).search(
|
||||||
[criteria, ("company_id", "=", self.company_id.id)], limit=1
|
[criteria, ("company_id", "=", self.company_id.id)], limit=1
|
||||||
)
|
)
|
||||||
if result:
|
if result:
|
||||||
|
|||||||
Reference in New Issue
Block a user