Skip to content

Commit

Permalink
misc-fix2review
Browse files Browse the repository at this point in the history
  • Loading branch information
bealdav committed Jun 7, 2024
1 parent 196ccc3 commit 4875e19
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 11 deletions.
8 changes: 8 additions & 0 deletions account_ecotax/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-mourad-ehm| image:: https://github.com/mourad-ehm.png?size=40px
:target: https://github.com/mourad-ehm
:alt: mourad-ehm

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-mourad-ehm|

This module is part of the `OCA/account-fiscal-rule <https://github.com/OCA/account-fiscal-rule/tree/16.0/account_ecotax>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_ecotax/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"website": "https://github.com/OCA/account-fiscal-rule",
"category": "Localization/Account Taxes",
"license": "AGPL-3",
"maintainers": ["mourad-ehm"],
"depends": [
"account",
"account_tax_python",
Expand Down
2 changes: 1 addition & 1 deletion account_ecotax/models/account_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ def onchange_is_ecotax(self):
# partner: res.partner object or None
# for weight based ecotax
# result = product.weight_based_ecotax or 0.0
result = product.ecotax_amount or 0.0
result = product.fixed_ecotax or 0.0
"""
9 changes: 4 additions & 5 deletions account_ecotax/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ class ProductProduct(models.Model):
ecotax_amount = fields.Float(
digits="Ecotax",
compute="_compute_product_ecotax",
help="Ecotax Amount computed form all ecotax line classification",
store=True,
help="Ecotax Amount computed form all ecotax line classification",
)
fixed_ecotax = fields.Float(
compute="_compute_product_ecotax",
store=True,
help="Fixed ecotax of the Ecotax Classification",
)
weight_based_ecotax = fields.Float(
compute="_compute_product_ecotax",
help="Ecotax value :\n"
"product weight * ecotax coef of "
"Ecotax Classification",
store=True,
help="Ecotax value :\n" "product weight * ecotax coef of Ecotax Classification",
)

@api.depends("ecotax_line_product_ids", "additional_ecotax_line_product_ids")
Expand Down Expand Up @@ -84,7 +84,6 @@ def _compute_product_ecotax(self):
weight_based_ecotax += ecotaxline_prod.amount
else:
fixed_ecotax += ecotaxline_prod.amount

amount_ecotax += ecotaxline_prod.amount
product.fixed_ecotax = fixed_ecotax
product.weight_based_ecotax = weight_based_ecotax
Expand Down
7 changes: 3 additions & 4 deletions account_ecotax/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class ProductTemplate(models.Model):
fixed_ecotax = fields.Float(
compute="_compute_ecotax",
help="Fixed ecotax of the Ecotax Classification",
store=True,
)
weight_based_ecotax = fields.Float(
compute="_compute_ecotax",
help="Ecotax value :\n"
"product weight * ecotax coef of "
"Ecotax Classification",
help="Ecotax value :\nproduct weight * ecotax coef of Ecotax Classification",
store=True,
)

@api.depends(
Expand All @@ -50,7 +50,6 @@ def _compute_ecotax(self):
weight_based_ecotax += ecotaxline_prod.amount
else:
fixed_ecotax += ecotaxline_prod.amount

amount_ecotax += ecotaxline_prod.amount
tmpl.fixed_ecotax = fixed_ecotax
tmpl.weight_based_ecotax = weight_based_ecotax
Expand Down
2 changes: 2 additions & 0 deletions account_ecotax/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/mourad-ehm"><img alt="mourad-ehm" src="https://github.com/mourad-ehm.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-fiscal-rule/tree/16.0/account_ecotax">OCA/account-fiscal-rule</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>
</div>
Expand Down
2 changes: 1 addition & 1 deletion account_ecotax/tests/test_ecotax.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@tagged("-at_install", "post_install")
class TestInvoiceEcotaxe(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref="l10n_fr.l10n_fr_pcg_chart_template"):
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref)
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))

Expand Down

0 comments on commit 4875e19

Please sign in to comment.