From fc67913ddb93c1d19cdbe1a61ab475ccac249b5b Mon Sep 17 00:00:00 2001 From: Mourad Date: Tue, 29 Oct 2024 12:18:46 +0100 Subject: [PATCH] IMP readme usage --- account_ecotax/README.rst | 39 ++++++++++++--- account_ecotax/models/account_tax.py | 4 +- account_ecotax/readme/USAGE.rst | 39 ++++++++++++--- account_ecotax/static/description/index.html | 50 +++++++++++++++++--- 4 files changed, 109 insertions(+), 23 deletions(-) diff --git a/account_ecotax/README.rst b/account_ecotax/README.rst index 0c2e1e61e..005d93a84 100644 --- a/account_ecotax/README.rst +++ b/account_ecotax/README.rst @@ -68,16 +68,41 @@ product.template ecotaxe_line_product_ids Usage ===== -Add ecotaxe classification via the menu *Accounting > configuration > Taxes > Ecotaxe Classification*. -Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe. -ecotaxe classification Infos can be used for legal declarations. -For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product. +1. Create a tax group named **"Ecotaxes"**. The sequence must be lower than other tax groups. + - Set the **Preceding Subtotal** field to **"Without Ecotax"**. -For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials). +2. Create two taxes named **"Fixed Ecotax"** and **"Weight-Based Ecotax"**. + - Check the **Ecotax** checkbox. + - Set the correct Python code: -Assign one or more ecotaxe classification to a product. + - For the fixed ecotax: -we can also force amount ecotaxe on account move line by classification. + .. code-block:: python + + result = quantity and product.fixed_ecotax * quantity or 0.0 + + - For the weight-based ecotax: + + .. code-block:: python + + result = quantity and product.weight_based_ecotax * quantity or 0.0 + + - Check the **Included in Base Amount** option. + - The sequence for Ecotax must be lower than the VAT tax. + +3. For VAT taxes, check the **Base Affected by Previous Taxes?** option. + +4. Add an ecotax classification via the menu **Accounting > Configuration > Taxes > Ecotax Classification**. + + - The ecotax classification can be either a fixed ecotax or a weight-based ecotax. + - Ecotax classification information can be used for legal declarations. + - For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product. + - For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product's materials). + - Set the appropriate tax in the **Sale Ecotax** field. + +5. Assign one or more ecotax classifications to a product. + + - The ecotax amount can also be manually overridden on the product. Bug Tracker =========== diff --git a/account_ecotax/models/account_tax.py b/account_ecotax/models/account_tax.py index 1d9bea8a2..fd592c692 100644 --- a/account_ecotax/models/account_tax.py +++ b/account_ecotax/models/account_tax.py @@ -27,6 +27,6 @@ def onchange_is_ecotax(self): # product: product.product object or None # partner: res.partner object or None # for weight based ecotax -# result = product.weight_based_ecotax or 0.0 -result = product.fixed_ecotax or 0.0 +# result = quantity and product.weight_based_ecotax * quantity or 0.0 +result = quantity and product.fixed_ecotax * quantity or 0.0 """ diff --git a/account_ecotax/readme/USAGE.rst b/account_ecotax/readme/USAGE.rst index b8d93a29d..1916d796c 100644 --- a/account_ecotax/readme/USAGE.rst +++ b/account_ecotax/readme/USAGE.rst @@ -1,10 +1,35 @@ -Add ecotaxe classification via the menu *Accounting > configuration > Taxes > Ecotaxe Classification*. -Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe. -ecotaxe classification Infos can be used for legal declarations. -For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product. +1. Create a tax group named **"Ecotaxes"**. The sequence must be lower than other tax groups. + - Set the **Preceding Subtotal** field to **"Without Ecotax"**. -For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials). +2. Create two taxes named **"Fixed Ecotax"** and **"Weight-Based Ecotax"**. + - Check the **Ecotax** checkbox. + - Set the correct Python code: -Assign one or more ecotaxe classification to a product. + - For the fixed ecotax: -we can also force amount ecotaxe on account move line by classification. + .. code-block:: python + + result = quantity and product.fixed_ecotax * quantity or 0.0 + + - For the weight-based ecotax: + + .. code-block:: python + + result = quantity and product.weight_based_ecotax * quantity or 0.0 + + - Check the **Included in Base Amount** option. + - The sequence for Ecotax must be lower than the VAT tax. + +3. For VAT taxes, check the **Base Affected by Previous Taxes?** option. + +4. Add an ecotax classification via the menu **Accounting > Configuration > Taxes > Ecotax Classification**. + + - The ecotax classification can be either a fixed ecotax or a weight-based ecotax. + - Ecotax classification information can be used for legal declarations. + - For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product. + - For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product's materials). + - Set the appropriate tax in the **Sale Ecotax** field. + +5. Assign one or more ecotax classifications to a product. + + - The ecotax amount can also be manually overridden on the product. diff --git a/account_ecotax/static/description/index.html b/account_ecotax/static/description/index.html index a3588d0c2..e4f0bf311 100644 --- a/account_ecotax/static/description/index.html +++ b/account_ecotax/static/description/index.html @@ -408,13 +408,49 @@

Ecotax Management

Usage

-

Add ecotaxe classification via the menu Accounting > configuration > Taxes > Ecotaxe Classification. -Ecotaxe classification is either a fixed ecotaxe or weight based ecotaxe. -ecotaxe classification Infos can be used for legal declarations. -For fixed ecotaxe, ecotaxe amount is used as default value. We can for ecotaxe amount on product.

-

For weight based ecotaxe, we should define one ecotaxe by coef applied for the weight (depending on product materials).

-

Assign one or more ecotaxe classification to a product.

-

we can also force amount ecotaxe on account move line by classification.

+
    +
  1. Create a tax group named “Ecotaxes”. The sequence must be lower than other tax groups. +- Set the Preceding Subtotal field to “Without Ecotax”.

    +
  2. +
  3. Create two taxes named “Fixed Ecotax” and “Weight-Based Ecotax”. +- Check the Ecotax checkbox. +- Set the correct Python code:

    +
    +
      +
    • For the fixed ecotax:

      +
      +result = quantity and product.fixed_ecotax * quantity or 0.0
      +
      +
    • +
    • For the weight-based ecotax:

      +
      +result = quantity and product.weight_based_ecotax * quantity or 0.0
      +
      +
    • +
    +
    +
      +
    • Check the Included in Base Amount option.
    • +
    • The sequence for Ecotax must be lower than the VAT tax.
    • +
    +
  4. +
  5. For VAT taxes, check the Base Affected by Previous Taxes? option.

    +
  6. +
  7. Add an ecotax classification via the menu Accounting > Configuration > Taxes > Ecotax Classification.

    +
      +
    • The ecotax classification can be either a fixed ecotax or a weight-based ecotax.
    • +
    • Ecotax classification information can be used for legal declarations.
    • +
    • For the fixed ecotax, the ecotax amount is used as a default value, which can be overridden on the product.
    • +
    • For the weight-based ecotax, define one ecotax by a coefficient applied to the weight (depending on the product’s materials).
    • +
    • Set the appropriate tax in the Sale Ecotax field.
    • +
    +
  8. +
  9. Assign one or more ecotax classifications to a product.

    +
      +
    • The ecotax amount can also be manually overridden on the product.
    • +
    +
  10. +

Bug Tracker