Skip to content

Commit fc67913

Browse files
committed
IMP readme usage
1 parent ec38154 commit fc67913

File tree

4 files changed

+109
-23
lines changed

4 files changed

+109
-23
lines changed

account_ecotax/README.rst

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,41 @@ product.template ecotaxe_line_product_ids
6868
Usage
6969
=====
7070

71-
Add ecotaxe classification via the menu *Accounting > configuration > Taxes > Ecotaxe Classification*.
72-
Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe.
73-
ecotaxe classification Infos can be used for legal declarations.
74-
For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product.
71+
1. Create a tax group named **"Ecotaxes"**. The sequence must be lower than other tax groups.
72+
- Set the **Preceding Subtotal** field to **"Without Ecotax"**.
7573

76-
For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials).
74+
2. Create two taxes named **"Fixed Ecotax"** and **"Weight-Based Ecotax"**.
75+
- Check the **Ecotax** checkbox.
76+
- Set the correct Python code:
7777

78-
Assign one or more ecotaxe classification to a product.
78+
- For the fixed ecotax:
7979

80-
we can also force amount ecotaxe on account move line by classification.
80+
.. code-block:: python
81+
82+
result = quantity and product.fixed_ecotax * quantity or 0.0
83+
84+
- For the weight-based ecotax:
85+
86+
.. code-block:: python
87+
88+
result = quantity and product.weight_based_ecotax * quantity or 0.0
89+
90+
- Check the **Included in Base Amount** option.
91+
- The sequence for Ecotax must be lower than the VAT tax.
92+
93+
3. For VAT taxes, check the **Base Affected by Previous Taxes?** option.
94+
95+
4. Add an ecotax classification via the menu **Accounting > Configuration > Taxes > Ecotax Classification**.
96+
97+
- The ecotax classification can be either a fixed ecotax or a weight-based ecotax.
98+
- Ecotax classification information can be used for legal declarations.
99+
- For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product.
100+
- For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product's materials).
101+
- Set the appropriate tax in the **Sale Ecotax** field.
102+
103+
5. Assign one or more ecotax classifications to a product.
104+
105+
- The ecotax amount can also be manually overridden on the product.
81106

82107
Bug Tracker
83108
===========

account_ecotax/models/account_tax.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ def onchange_is_ecotax(self):
2727
# product: product.product object or None
2828
# partner: res.partner object or None
2929
# for weight based ecotax
30-
# result = product.weight_based_ecotax or 0.0
31-
result = product.fixed_ecotax or 0.0
30+
# result = quantity and product.weight_based_ecotax * quantity or 0.0
31+
result = quantity and product.fixed_ecotax * quantity or 0.0
3232
"""

account_ecotax/readme/USAGE.rst

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
1-
Add ecotaxe classification via the menu *Accounting > configuration > Taxes > Ecotaxe Classification*.
2-
Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe.
3-
ecotaxe classification Infos can be used for legal declarations.
4-
For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product.
1+
1. Create a tax group named **"Ecotaxes"**. The sequence must be lower than other tax groups.
2+
- Set the **Preceding Subtotal** field to **"Without Ecotax"**.
53

6-
For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials).
4+
2. Create two taxes named **"Fixed Ecotax"** and **"Weight-Based Ecotax"**.
5+
- Check the **Ecotax** checkbox.
6+
- Set the correct Python code:
77

8-
Assign one or more ecotaxe classification to a product.
8+
- For the fixed ecotax:
99

10-
we can also force amount ecotaxe on account move line by classification.
10+
.. code-block:: python
11+
12+
result = quantity and product.fixed_ecotax * quantity or 0.0
13+
14+
- For the weight-based ecotax:
15+
16+
.. code-block:: python
17+
18+
result = quantity and product.weight_based_ecotax * quantity or 0.0
19+
20+
- Check the **Included in Base Amount** option.
21+
- The sequence for Ecotax must be lower than the VAT tax.
22+
23+
3. For VAT taxes, check the **Base Affected by Previous Taxes?** option.
24+
25+
4. Add an ecotax classification via the menu **Accounting > Configuration > Taxes > Ecotax Classification**.
26+
27+
- The ecotax classification can be either a fixed ecotax or a weight-based ecotax.
28+
- Ecotax classification information can be used for legal declarations.
29+
- For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product.
30+
- For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product's materials).
31+
- Set the appropriate tax in the **Sale Ecotax** field.
32+
33+
5. Assign one or more ecotax classifications to a product.
34+
35+
- The ecotax amount can also be manually overridden on the product.

account_ecotax/static/description/index.html

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,13 +408,49 @@ <h1 class="title">Ecotax Management</h1>
408408
</div>
409409
<div class="section" id="usage">
410410
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
411-
<p>Add ecotaxe classification via the menu <em>Accounting &gt; configuration &gt; Taxes &gt; Ecotaxe Classification</em>.
412-
Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe.
413-
ecotaxe classification Infos can be used for legal declarations.
414-
For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product.</p>
415-
<p>For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials).</p>
416-
<p>Assign one or more ecotaxe classification to a product.</p>
417-
<p>we can also force amount ecotaxe on account move line by classification.</p>
411+
<ol class="arabic">
412+
<li><p class="first">Create a tax group named <strong>“Ecotaxes”</strong>. The sequence must be lower than other tax groups.
413+
- Set the <strong>Preceding Subtotal</strong> field to <strong>“Without Ecotax”</strong>.</p>
414+
</li>
415+
<li><p class="first">Create two taxes named <strong>“Fixed Ecotax”</strong> and <strong>“Weight-Based Ecotax”</strong>.
416+
- Check the <strong>Ecotax</strong> checkbox.
417+
- Set the correct Python code:</p>
418+
<blockquote>
419+
<ul>
420+
<li><p class="first">For the fixed ecotax:</p>
421+
<pre class="code python literal-block">
422+
<span class="n">result</span> <span class="o">=</span> <span class="n">quantity</span> <span class="ow">and</span> <span class="n">product</span><span class="o">.</span><span class="n">fixed_ecotax</span> <span class="o">*</span> <span class="n">quantity</span> <span class="ow">or</span> <span class="mf">0.0</span>
423+
</pre>
424+
</li>
425+
<li><p class="first">For the weight-based ecotax:</p>
426+
<pre class="code python literal-block">
427+
<span class="n">result</span> <span class="o">=</span> <span class="n">quantity</span> <span class="ow">and</span> <span class="n">product</span><span class="o">.</span><span class="n">weight_based_ecotax</span> <span class="o">*</span> <span class="n">quantity</span> <span class="ow">or</span> <span class="mf">0.0</span>
428+
</pre>
429+
</li>
430+
</ul>
431+
</blockquote>
432+
<ul class="simple">
433+
<li>Check the <strong>Included in Base Amount</strong> option.</li>
434+
<li>The sequence for Ecotax must be lower than the VAT tax.</li>
435+
</ul>
436+
</li>
437+
<li><p class="first">For VAT taxes, check the <strong>Base Affected by Previous Taxes?</strong> option.</p>
438+
</li>
439+
<li><p class="first">Add an ecotax classification via the menu <strong>Accounting &gt; Configuration &gt; Taxes &gt; Ecotax Classification</strong>.</p>
440+
<ul class="simple">
441+
<li>The ecotax classification can be either a fixed ecotax or a weight-based ecotax.</li>
442+
<li>Ecotax classification information can be used for legal declarations.</li>
443+
<li>For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product.</li>
444+
<li>For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product’s materials).</li>
445+
<li>Set the appropriate tax in the <strong>Sale Ecotax</strong> field.</li>
446+
</ul>
447+
</li>
448+
<li><p class="first">Assign one or more ecotax classifications to a product.</p>
449+
<ul class="simple">
450+
<li>The ecotax amount can also be manually overridden on the product.</li>
451+
</ul>
452+
</li>
453+
</ol>
418454
</div>
419455
<div class="section" id="bug-tracker">
420456
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>

0 commit comments

Comments
 (0)