Skip to content

Commit c01b7c6

Browse files
committed
[ADD] account_tax_product_amount: set tax amount per product variant
1 parent 62cf4a3 commit c01b7c6

23 files changed

+1574
-0
lines changed
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
==========================
2+
Account tax product amount
3+
==========================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:3368002193eca20078520b870a3ea0e9948107b8c03af38d3e94e7ad10092df6
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--fiscal--rule-lightgray.png?logo=github
20+
:target: https://github.com/OCA/account-fiscal-rule/tree/18.0/account_tax_product_amount
21+
:alt: OCA/account-fiscal-rule
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/account-fiscal-rule-18-0/account-fiscal-rule-18-0-account_tax_product_amount
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module allows you to manage fixed tax amounts that vary per product
32+
variant.
33+
34+
By default, Odoo manages fixed tax amounts at the tax level. However,
35+
some taxes effectively depend on product characteristics (like
36+
dimensions, weight, or material) while sharing the same tax
37+
configuration (same account, same name, same tax report line).
38+
39+
With this module, you can configure a tax with ``Amount Type`` set to
40+
``Fixed`` and enable the **Use Product Amount** option. This tells Odoo
41+
to look for the specific amount defined on the product variant. If no
42+
specific amount is found for the variant, the default amount defined on
43+
the tax is used.
44+
45+
**Features:**
46+
47+
- Define specific tax amounts per product variant.
48+
- Support for multiple taxes per product.
49+
- Multi-company support.
50+
- Compatible with Sales, Purchases, Invoicing, and Website Sales.
51+
52+
..
53+
54+
**Note**: This module is particularly useful for handling
55+
**Eco-taxes** (or similar levies) and offers advantages over other
56+
community modules:
57+
58+
- Compared to ``account_ecotax``: This module relies on the standard
59+
Odoo Tax engine. This makes it natively compatible with accounting,
60+
invoicing, and reporting without needing glue modules for every
61+
application (Sales, Purchase, POS, etc.). It also allows using
62+
different accounts per tax easily.
63+
- Compared to ``account_ecotax_tax``: This module does not rely on
64+
``account_tax_python`` (Python Code taxes), which can be complex to
65+
maintain. It also supports multiple different tax amounts for a
66+
single variant independently and offers better flexibility.
67+
68+
**Table of contents**
69+
70+
.. contents::
71+
:local:
72+
73+
Configuration
74+
=============
75+
76+
To configure this module, you need to:
77+
78+
1. **Configure Accounts**: Setup specific accounts for your taxes in
79+
your Chart of Accounts, or decide which existing accounts to use.
80+
81+
2. **Create a Tax**:
82+
83+
- Go to **Accounting > Configuration > Taxes**.
84+
- Create a new tax.
85+
- Set **Tax Computation** (Amount Type) to ``Fixed``.
86+
- Check the box **Use Product Amount**.
87+
- Set a default **Amount**. This will be used as a fallback if no
88+
specific amount is set on the product variant.
89+
- Configure other settings (Accounts, Tax Group, Label on Invoices,
90+
etc.) as usual.
91+
92+
3. **Add tax on product template**:
93+
94+
- Go to **Product template** form view.
95+
- Select the product template.
96+
- Add the tax to the **Sales/Purchase Taxes** field.
97+
- Save the record this will generate the tax amount records for all
98+
existing variants using the default tax amount.
99+
100+
4. **Define Amounts on Products**:
101+
102+
- Go to the **Product Variant** form view.
103+
- You will find a new tab or section (depending on view
104+
configuration) to set the fixed amounts for each tax that has "Use
105+
Product Amount" enabled.
106+
- Alternatively, go to **Accounting > Configuration > Accounting >
107+
Tax > Product Amounts** to see and manage all product tax amounts
108+
in one place.
109+
110+
**Eco-Tax Example (France)**
111+
112+
In France, the "Éco-participation" (Eco-tax) is a fixed contribution
113+
added to the price of new items to fund recycling and waste management.
114+
The amount depends on the product's characteristics (weight, type,
115+
material).
116+
117+
*Scenario*: You sell a sofa that contains electronic components (e.g., a
118+
massage sofa). This product is subject to two distinct eco-taxes: one
119+
for the furniture (Eco-mobilier) and one for the electronics (DEEE).
120+
121+
1. **Purchase**: When you buy the goods, the eco-tax is billed by your
122+
supplier. It is not recoverable VAT but an expense spread over the
123+
product cost.
124+
125+
- We advise using a dedicated Expense Account (e.g., ``607...``) for
126+
each tax or a generic one to track these costs.
127+
128+
2. **Sale**: When you sell the product, you collect the eco-tax from the
129+
customer.
130+
131+
- Use a dedicated Income Account (e.g., ``707...`` or a liability
132+
account depending on your accounting rules) for the tax.
133+
- Since the Eco-tax is part of the taxable basis for VAT, ensure that
134+
the Eco-tax is applied *before* VAT.
135+
- In the Tax configuration, for the VAT tax, ensure "Affect Base of
136+
Subsequent Taxes" is checked (or simply ensure the Eco-tax is in a
137+
Tax Group with lower sequence/sequence number so it applies first,
138+
and VAT applies on top).
139+
140+
*Calculation Example*:
141+
142+
- Sofa Base Price: 10.00€
143+
- Eco-mobilier (Furniture Tax): 1.50€
144+
- VAT (20%): Applied on (10.00€ + 1.50€) = 11.50€ \* 20% = 2.30€
145+
- **Total Price**: 10.00€ + 1.50€ + 2.30€ = 13.80€
146+
147+
*Journal Entries*:
148+
149+
- **Credit** 707000 Product Sales: 10.00€
150+
- **Credit** 707100 Eco-tax Income (or similar): 1.50€
151+
- **Credit** 445700 Output VAT: 2.30€
152+
- **Debit** 411100 Customer Receivable: 13.80€
153+
154+
Usage
155+
=====
156+
157+
Once configured:
158+
159+
1. Create a Sales Order, Purchase Order, or Invoice.
160+
2. Select a Product Variant that has a specific tax amount configured.
161+
3. Add the corresponding tax (the one with "Use Product Amount" checked)
162+
to the line.
163+
164+
..
165+
166+
**Note**: If the tax is set as a Default Tax on the product, it will
167+
be added automatically.
168+
169+
4. Odoo will compute the tax amount based on the value defined for the
170+
selected variant.
171+
5. If you change the quantity, the fixed tax amount is multiplied by the
172+
quantity (e.g., 2 units \* 1.50€ = 3.00€ tax).
173+
174+
Known issues / Roadmap
175+
======================
176+
177+
- Allow setting the tax amount directly from the **Product Template**
178+
view when the product has only one variant.
179+
- Support for **Point of Sale (POS)** via a dedicated bridge module
180+
(e.g., ``pos_account_tax_product_amount``).
181+
182+
Bug Tracker
183+
===========
184+
185+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-fiscal-rule/issues>`_.
186+
In case of trouble, please check there if your issue has already been reported.
187+
If you spotted it first, help us to smash it by providing a detailed and welcomed
188+
`feedback <https://github.com/OCA/account-fiscal-rule/issues/new?body=module:%20account_tax_product_amount%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
189+
190+
Do not contact contributors directly about support or help with technical issues.
191+
192+
Credits
193+
=======
194+
195+
Authors
196+
-------
197+
198+
* Pierre Verkest
199+
200+
Maintainers
201+
-----------
202+
203+
This module is maintained by the OCA.
204+
205+
.. image:: https://odoo-community.org/logo.png
206+
:alt: Odoo Community Association
207+
:target: https://odoo-community.org
208+
209+
OCA, or the Odoo Community Association, is a nonprofit organization whose
210+
mission is to support the collaborative development of Odoo features and
211+
promote its widespread use.
212+
213+
.. |maintainer-petrus-v| image:: https://github.com/petrus-v.png?size=40px
214+
:target: https://github.com/petrus-v
215+
:alt: petrus-v
216+
217+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
218+
219+
|maintainer-petrus-v|
220+
221+
This module is part of the `OCA/account-fiscal-rule <https://github.com/OCA/account-fiscal-rule/tree/18.0/account_tax_product_amount>`_ project on GitHub.
222+
223+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2025 Pierre Verkest <[email protected]>
2+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
3+
{
4+
"name": "Account tax product amount",
5+
"summary": "Manage tax amount per product variant",
6+
"version": "18.0.1.0.0",
7+
"category": "Accounting/Accounting",
8+
"license": "LGPL-3",
9+
"author": "Pierre Verkest, Odoo Community Association (OCA)",
10+
"maintainers": ["petrus-v"],
11+
"depends": ["account", "product"],
12+
"data": [
13+
"security/ir.model.access.csv",
14+
"security/ir_rules.xml",
15+
"views/account_tax_view.xml",
16+
"views/account_tax_product_amount_view.xml",
17+
"views/product_product_view.xml",
18+
],
19+
"website": "https://github.com/OCA/account-fiscal-rule",
20+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * account_tax_product_amount
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 18.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"Last-Translator: \n"
10+
"Language-Team: \n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: \n"
15+
16+
#. module: account_tax_product_amount
17+
#: model:ir.model,name:account_tax_product_amount.model_account_tax_product_amount
18+
msgid "Account Tax Product Amounts (ie: usefull to manage ecotax)"
19+
msgstr ""
20+
21+
#. module: account_tax_product_amount
22+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__amount
23+
msgid "Amount"
24+
msgstr ""
25+
26+
#. module: account_tax_product_amount
27+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__company_id
28+
msgid "Company"
29+
msgstr ""
30+
31+
#. module: account_tax_product_amount
32+
#: model_terms:ir.actions.act_window,help:account_tax_product_amount.action_tax_product_amount
33+
msgid "Create a new tax amount for a product variant"
34+
msgstr ""
35+
36+
#. module: account_tax_product_amount
37+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__create_uid
38+
msgid "Created by"
39+
msgstr ""
40+
41+
#. module: account_tax_product_amount
42+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__create_date
43+
msgid "Created on"
44+
msgstr ""
45+
46+
#. module: account_tax_product_amount
47+
#: model:ir.model.fields,help:account_tax_product_amount.field_product_product__tax_amount_ids
48+
msgid "Define specific tax fixed amounts for this variant."
49+
msgstr ""
50+
51+
#. module: account_tax_product_amount
52+
#: model:ir.model.fields,help:account_tax_product_amount.field_account_tax_product_amount__type_tax_use
53+
msgid ""
54+
"Determines where the tax is selectable. Note: 'None' means a tax can't be "
55+
"used by itself, however it can still be used in a group. 'adjustment' is "
56+
"used to perform tax adjustment."
57+
msgstr ""
58+
59+
#. module: account_tax_product_amount
60+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__display_name
61+
msgid "Display Name"
62+
msgstr ""
63+
64+
#. module: account_tax_product_amount
65+
#: model_terms:ir.ui.view,arch_db:account_tax_product_amount.product_normal_form_view
66+
msgid "Fixed Tax Amount"
67+
msgstr ""
68+
69+
#. module: account_tax_product_amount
70+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__id
71+
msgid "ID"
72+
msgstr ""
73+
74+
#. module: account_tax_product_amount
75+
#: model:ir.model.fields,help:account_tax_product_amount.field_account_tax__use_product_amount
76+
msgid ""
77+
"If checked, the tax amount is taken from the product variant (with a "
78+
"fallback to the tax amount)."
79+
msgstr ""
80+
81+
#. module: account_tax_product_amount
82+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__write_uid
83+
msgid "Last Updated by"
84+
msgstr ""
85+
86+
#. module: account_tax_product_amount
87+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__write_date
88+
msgid "Last Updated on"
89+
msgstr ""
90+
91+
#. module: account_tax_product_amount
92+
#: model:ir.model,name:account_tax_product_amount.model_product_template
93+
msgid "Product"
94+
msgstr ""
95+
96+
#. module: account_tax_product_amount
97+
#: model:ir.model,name:account_tax_product_amount.model_product_product
98+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__product_id
99+
msgid "Product Variant"
100+
msgstr ""
101+
102+
#. module: account_tax_product_amount
103+
#: model:ir.model,name:account_tax_product_amount.model_account_tax
104+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__tax_id
105+
msgid "Tax"
106+
msgstr ""
107+
108+
#. module: account_tax_product_amount
109+
#: model:ir.actions.act_window,name:account_tax_product_amount.action_tax_product_amount
110+
#: model:ir.ui.menu,name:account_tax_product_amount.menu_tax_product_amount
111+
msgid "Tax Product Amount"
112+
msgstr ""
113+
114+
#. module: account_tax_product_amount
115+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax_product_amount__type_tax_use
116+
msgid "Tax Type"
117+
msgstr ""
118+
119+
#. module: account_tax_product_amount
120+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_product_product__tax_amount_ids
121+
msgid "Tax fixed amounts"
122+
msgstr ""
123+
124+
#. module: account_tax_product_amount
125+
#: model:ir.model.constraint,message:account_tax_product_amount.constraint_account_tax_product_amount_product_tax_unique
126+
msgid "The tax amount must be unique per product variant and tax."
127+
msgstr ""
128+
129+
#. module: account_tax_product_amount
130+
#: model_terms:ir.ui.view,arch_db:account_tax_product_amount.product_normal_form_view
131+
#: model_terms:ir.ui.view,arch_db:account_tax_product_amount.product_variant_easy_edit_view
132+
msgid ""
133+
"To add / remove tax amount line, please use\n"
134+
" Sales/Purchase Taxes field on product template."
135+
msgstr ""
136+
137+
#. module: account_tax_product_amount
138+
#: model:ir.model.fields,field_description:account_tax_product_amount.field_account_tax__use_product_amount
139+
msgid "Use Product Amount"
140+
msgstr ""

0 commit comments

Comments
 (0)