mirror of
https://github.com/bringout/oca-financial.git
synced 2026-04-27 02:42:00 +02:00
Initial commit: OCA Financial packages (186 packages)
This commit is contained in:
commit
3e0e8473fb
8757 changed files with 947473 additions and 0 deletions
|
|
@ -0,0 +1,45 @@
|
|||
# sale Ecotax Management
|
||||
|
||||
Odoo addon: account_ecotax_sale
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-account-fiscal-rule-account_ecotax_sale
|
||||
```
|
||||
|
||||
## Dependencies
|
||||
|
||||
This addon depends on:
|
||||
- account_ecotax
|
||||
- sale
|
||||
|
||||
## Manifest Information
|
||||
|
||||
- **Name**: sale Ecotax Management
|
||||
- **Version**: 16.0.2.0.1
|
||||
- **Category**: Localization/Account Taxes
|
||||
- **License**: AGPL-3
|
||||
- **Installable**: True
|
||||
|
||||
## Source
|
||||
|
||||
Based on [OCA/account-fiscal-rule](https://github.com/OCA/account-fiscal-rule) branch 16.0, addon `account_ecotax_sale`.
|
||||
|
||||
## License
|
||||
|
||||
This package maintains the original AGPL-3 license from the upstream Odoo project.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Overview: doc/OVERVIEW.md
|
||||
- Architecture: doc/ARCHITECTURE.md
|
||||
- Models: doc/MODELS.md
|
||||
- Controllers: doc/CONTROLLERS.md
|
||||
- Wizards: doc/WIZARDS.md
|
||||
- Install: doc/INSTALL.md
|
||||
- Usage: doc/USAGE.md
|
||||
- Configuration: doc/CONFIGURATION.md
|
||||
- Dependencies: doc/DEPENDENCIES.md
|
||||
- Troubleshooting: doc/TROUBLESHOOTING.md
|
||||
- FAQ: doc/FAQ.md
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
======================
|
||||
sale Ecotax Management
|
||||
======================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:074afe29b8a676da4886091b345b213defabcb9d874261a0978e4ea3f4e312dc
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||
:target: https://odoo-community.org/page/development-status
|
||||
:alt: Beta
|
||||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--fiscal--rule-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/account-fiscal-rule/tree/16.0/account_ecotax_sale
|
||||
:alt: OCA/account-fiscal-rule
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/account-fiscal-rule-16-0/account-fiscal-rule-16-0-account_ecotax_sale
|
||||
:alt: Translate me on Weblate
|
||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
||||
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=16.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module is an extension of the module *l10n_fr_ecotax* for sale orders. Please refer to the README of the module *account_ecotax* for more info about ecotax management.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-fiscal-rule/issues>`_.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
`feedback <https://github.com/OCA/account-fiscal-rule/issues/new?body=module:%20account_ecotax_sale%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
|
||||
Do not contact contributors directly about support or help with technical issues.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Authors
|
||||
~~~~~~~
|
||||
|
||||
* Akretion
|
||||
|
||||
Contributors
|
||||
~~~~~~~~~~~~
|
||||
|
||||
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
* Florian DA COSTA <florian.dacosta@akretion.com>
|
||||
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
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
|
||||
.. |maintainer-florian-dacosta| image:: https://github.com/florian-dacosta.png?size=40px
|
||||
:target: https://github.com/florian-dacosta
|
||||
:alt: florian-dacosta
|
||||
|
||||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|
||||
|
||||
|maintainer-mourad-ehm| |maintainer-florian-dacosta|
|
||||
|
||||
This module is part of the `OCA/account-fiscal-rule <https://github.com/OCA/account-fiscal-rule/tree/16.0/account_ecotax_sale>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
from . import models
|
||||
from .hook import pre_init_hook
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# © 2014-2023 Akretion (http://www.akretion.com)
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "sale Ecotax Management",
|
||||
"summary": "Sale Ecotaxe",
|
||||
"version": "16.0.2.0.1",
|
||||
"maintainers": ["mourad-ehm", "florian-dacosta"],
|
||||
"author": "Akretion,Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/account-fiscal-rule",
|
||||
"category": "Localization/Account Taxes",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["account_ecotax", "sale"],
|
||||
"data": [
|
||||
"views/sale_view.xml",
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
"installable": True,
|
||||
"pre_init_hook": "pre_init_hook",
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
def pre_init_hook(cr):
|
||||
|
||||
cr.execute(
|
||||
"""
|
||||
ALTER TABLE sale_order ADD COLUMN IF NOT EXISTS amount_ecotax numeric
|
||||
"""
|
||||
)
|
||||
cr.execute(
|
||||
"""
|
||||
UPDATE sale_order SET amount_ecotax = 0.0 WHERE amount_ecotax IS NULL
|
||||
"""
|
||||
)
|
||||
cr.execute(
|
||||
"""
|
||||
ALTER TABLE sale_order_line ADD COLUMN IF NOT EXISTS subtotal_ecotax numeric
|
||||
"""
|
||||
)
|
||||
cr.execute(
|
||||
"""
|
||||
ALTER TABLE sale_order_line ADD COLUMN IF NOT EXISTS ecotax_amount_unit numeric
|
||||
"""
|
||||
)
|
||||
cr.execute(
|
||||
"""
|
||||
UPDATE sale_order_line
|
||||
SET ecotax_amount_unit = 0.0, subtotal_ecotax = 0.0
|
||||
WHERE ecotax_amount_unit IS NULL
|
||||
"""
|
||||
)
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_ecotax_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid "Amount Total"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Amount Unit"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__classification_id
|
||||
msgid "Classification"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__currency_id
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Delivered"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__subtotal_ecotax
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_order_form
|
||||
msgid "Ecotax"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Ecotax Amount computed from Classification or Manual ecotax"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid ""
|
||||
"Ecotax Amount total computed from Classification or forced ecotax amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_amount_unit
|
||||
msgid "Ecotax Unit"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_line_ids
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Ecotax lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid "Force Amount Unit"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid ""
|
||||
"Force ecotax.\n"
|
||||
"Allow to add a subtitle to the default Ecotax Classification"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order__amount_ecotax
|
||||
msgid "Included Ecotaxe"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Invoiced"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__product_id
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__quantity
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__sale_order_line_id
|
||||
msgid "Sale line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line_ecotax
|
||||
msgid "Sale order line ecotax"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line
|
||||
msgid "Sales Order Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Section Name (eg. Products, Services)"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Subtotal"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Total"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Total Ecotax"
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * l10n_fr_ecotaxe_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order__amount_ecotaxe
|
||||
msgid "Included Ecotaxe"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order_line
|
||||
msgid "Sales Order Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order_line__subtotal_ecotaxe
|
||||
msgid "Subtotal Ecotaxe"
|
||||
msgstr ""
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order_line__unit_ecotaxe_amount
|
||||
msgid "ecotaxe Unit."
|
||||
msgstr ""
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * l10n_fr_ecotaxe_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 15.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order__amount_ecotaxe
|
||||
msgid "Included Ecotaxe"
|
||||
msgstr "Uključena ekonaknada"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr "Prodajni nalog"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order_line
|
||||
msgid "Sales Order Line"
|
||||
msgstr "Stavka prodajne narudžbe"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order_line__subtotal_ecotaxe
|
||||
msgid "Subtotal Ecotaxe"
|
||||
msgstr "Podzbroj ekonaknada"
|
||||
|
||||
#. module: l10n_fr_ecotaxe_sale
|
||||
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order_line__unit_ecotaxe_amount
|
||||
msgid "ecotaxe Unit."
|
||||
msgstr "Jedinica ekonaknada"
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * l10n_fr_ecotaxe_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 15.0+e\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-03-01 13:01+0000\n"
|
||||
"PO-Revision-Date: 2022-03-01 13:01+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid "Amount Total"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Amount Unit"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__classification_id
|
||||
msgid "Classification"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__currency_id
|
||||
msgid "Currency"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Delivered"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Description"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__subtotal_ecotax
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_order_form
|
||||
msgid "Ecotax"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Ecotax Amount computed from Classification or Manual ecotax"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid ""
|
||||
"Ecotax Amount total computed from Classification or forced ecotax amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_amount_unit
|
||||
#, fuzzy
|
||||
msgid "Ecotax Unit"
|
||||
msgstr "Ecotaxe par Unité"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_line_ids
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Ecotax lines"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid "Force Amount Unit"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid ""
|
||||
"Force ecotax.\n"
|
||||
"Allow to add a subtitle to the default Ecotax Classification"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order__amount_ecotax
|
||||
msgid "Included Ecotaxe"
|
||||
msgstr "Ecotaxe Incluse"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Invoiced"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Note"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__product_id
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__quantity
|
||||
msgid "Quantity"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__sale_order_line_id
|
||||
#, fuzzy
|
||||
msgid "Sale line"
|
||||
msgstr "Ligne de bons de commande"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line_ecotax
|
||||
#, fuzzy
|
||||
msgid "Sale order line ecotax"
|
||||
msgstr "Ligne de bons de commande"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr "Bon de commande"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line
|
||||
msgid "Sales Order Line"
|
||||
msgstr "Ligne de bons de commande"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Section Name (eg. Products, Services)"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
#, fuzzy
|
||||
msgid "Subtotal"
|
||||
msgstr "Sous-total Ecotaxe"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Total"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
#, fuzzy
|
||||
msgid "Total Ecotax"
|
||||
msgstr "Sous-total Ecotaxe"
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_ecotax_sale
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2025-03-14 08:45+0000\n"
|
||||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 5.10.2\n"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid "Amount Total"
|
||||
msgstr "Importo totale"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Amount Unit"
|
||||
msgstr "Unità valore"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__classification_id
|
||||
msgid "Classification"
|
||||
msgstr "Classificazione"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creato da"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creato il"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__currency_id
|
||||
msgid "Currency"
|
||||
msgstr "Valuta"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Delivered"
|
||||
msgstr "Consegnato"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Description"
|
||||
msgstr "Descrizione"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome visualizzato"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__subtotal_ecotax
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_order_form
|
||||
msgid "Ecotax"
|
||||
msgstr "Imposta ecologica"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_unit
|
||||
msgid "Ecotax Amount computed from Classification or Manual ecotax"
|
||||
msgstr ""
|
||||
"Valore imposte ecologica calcolato dalla classificazione o imposta ecologica "
|
||||
"manuale"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__amount_total
|
||||
msgid ""
|
||||
"Ecotax Amount total computed from Classification or forced ecotax amount"
|
||||
msgstr ""
|
||||
"Totale valore imposte ecologica calcolato dalla classificazione o valore "
|
||||
"imposte ecologica forzato"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_amount_unit
|
||||
msgid "Ecotax Unit"
|
||||
msgstr "Unità imposta ecologica"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line__ecotax_line_ids
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Ecotax lines"
|
||||
msgstr "Righe imposte ecologica"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid "Force Amount Unit"
|
||||
msgstr "Forza unità valore"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,help:account_ecotax_sale.field_sale_order_line_ecotax__force_amount_unit
|
||||
msgid ""
|
||||
"Force ecotax.\n"
|
||||
"Allow to add a subtitle to the default Ecotax Classification"
|
||||
msgstr ""
|
||||
"Forza imposta ecologica.\n"
|
||||
"Consente di aggiungere un sotto titolo alla classificazione imposta "
|
||||
"ecologica predefinita"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order__amount_ecotax
|
||||
msgid "Included Ecotaxe"
|
||||
msgstr "Inclusa tassa ecologica"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Invoiced"
|
||||
msgstr "Fatturato"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Ultima modifica il"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Ultimo aggiornamento di"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Ultimo aggiornamento il"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Note"
|
||||
msgstr "Nota"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__product_id
|
||||
msgid "Product"
|
||||
msgstr "Prodotto"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__quantity
|
||||
msgid "Quantity"
|
||||
msgstr "Quantità"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model.fields,field_description:account_ecotax_sale.field_sale_order_line_ecotax__sale_order_line_id
|
||||
msgid "Sale line"
|
||||
msgstr "Riga di vendita"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line_ecotax
|
||||
msgid "Sale order line ecotax"
|
||||
msgstr "Tassa ecologica riga ordine di vendita"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order
|
||||
msgid "Sales Order"
|
||||
msgstr "Ordine di vendita"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model:ir.model,name:account_ecotax_sale.model_sale_order_line
|
||||
msgid "Sales Order Line"
|
||||
msgstr "Riga ordine di vendita"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Section Name (eg. Products, Services)"
|
||||
msgstr "Nome sezione (es. prodotti, servizi)"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Subtotal"
|
||||
msgstr "Subtotale"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Total"
|
||||
msgstr "Totale"
|
||||
|
||||
#. module: account_ecotax_sale
|
||||
#: model_terms:ir.ui.view,arch_db:account_ecotax_sale.view_sale_line_ecotax_form
|
||||
msgid "Total Ecotax"
|
||||
msgstr "Totale imposta ecologica"
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
from . import sale_order_line_ecotax
|
||||
from . import sale_order_line
|
||||
from . import sale_order
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# © 2015 -2023 Akretion (http://www.akretion.com)
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class SaleOrder(models.Model):
|
||||
|
||||
_inherit = "sale.order"
|
||||
|
||||
amount_ecotax = fields.Float(
|
||||
digits="Ecotaxe",
|
||||
string="Included Ecotaxe",
|
||||
store=True,
|
||||
compute="_compute_ecotax",
|
||||
)
|
||||
|
||||
@api.depends("order_line.subtotal_ecotax")
|
||||
def _compute_ecotax(self):
|
||||
for order in self:
|
||||
val_ecotax = 0.0
|
||||
for line in order.order_line:
|
||||
val_ecotax += line.subtotal_ecotax
|
||||
order.amount_ecotax = val_ecotax
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
# © 2015 -2023 Akretion (http://www.akretion.com)
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import Command, api, fields, models
|
||||
|
||||
|
||||
class SaleOrderLine(models.Model):
|
||||
|
||||
_inherit = "sale.order.line"
|
||||
|
||||
ecotax_line_ids = fields.One2many(
|
||||
"sale.order.line.ecotax",
|
||||
"sale_order_line_id",
|
||||
compute="_compute_ecotax_line_ids",
|
||||
store=True,
|
||||
readonly=False,
|
||||
string="Ecotax lines",
|
||||
copy=True,
|
||||
)
|
||||
subtotal_ecotax = fields.Float(
|
||||
string="Ecotax", digits="Ecotax", store=True, compute="_compute_ecotax"
|
||||
)
|
||||
ecotax_amount_unit = fields.Float(
|
||||
digits="Ecotax",
|
||||
string="Ecotax Unit",
|
||||
store=True,
|
||||
compute="_compute_ecotax",
|
||||
)
|
||||
|
||||
def _get_ecotax_amounts(self):
|
||||
self.ensure_one()
|
||||
unit = sum(self.ecotax_line_ids.mapped("amount_unit"))
|
||||
subtotal_ecotax = sum(self.ecotax_line_ids.mapped("amount_total"))
|
||||
return unit, subtotal_ecotax
|
||||
|
||||
@api.depends(
|
||||
"currency_id",
|
||||
"ecotax_line_ids.amount_unit",
|
||||
"ecotax_line_ids.amount_total",
|
||||
)
|
||||
def _compute_ecotax(self):
|
||||
for line in self:
|
||||
amount_unit, subtotal = line._get_ecotax_amounts()
|
||||
line.subtotal_ecotax = subtotal
|
||||
line.ecotax_amount_unit = amount_unit
|
||||
|
||||
def _get_new_vals_list(self):
|
||||
self.ensure_one()
|
||||
new_vals_list = [
|
||||
Command.create(
|
||||
{
|
||||
"classification_id": ecotaxline_prod.classification_id.id,
|
||||
"force_amount_unit": ecotaxline_prod.force_amount,
|
||||
}
|
||||
)
|
||||
for ecotaxline_prod in self.product_id.all_ecotax_line_product_ids
|
||||
]
|
||||
return new_vals_list
|
||||
|
||||
@api.depends("product_id")
|
||||
def _compute_ecotax_line_ids(self):
|
||||
"""Unlink and recreate ecotax_lines when modifying the product_id."""
|
||||
for line in self:
|
||||
delete_vals_list = [
|
||||
Command.delete(taxline.id) for taxline in line.ecotax_line_ids
|
||||
]
|
||||
new_vals_list = line._get_new_vals_list()
|
||||
update = new_vals_list + delete_vals_list
|
||||
line.ecotax_line_ids = update
|
||||
|
||||
def edit_ecotax_lines(self):
|
||||
view = {
|
||||
"name": ("Ecotax classification"),
|
||||
"view_type": "form",
|
||||
"view_mode": "form",
|
||||
"res_model": "sale.order.line",
|
||||
"view_id": self.env.ref(
|
||||
"account_ecotax_sale.view_sale_line_ecotax_form"
|
||||
).id,
|
||||
"type": "ir.actions.act_window",
|
||||
"target": "new",
|
||||
"res_id": self.id,
|
||||
}
|
||||
return view
|
||||
|
||||
def _prepare_invoice_line(self, **optional_values):
|
||||
"""Create equivalente ecotax_line_ids for account move line
|
||||
from sale order line ecotax_line_ids .
|
||||
"""
|
||||
res = super()._prepare_invoice_line(**optional_values)
|
||||
ecotax_cls_vals = []
|
||||
for ecotaxline in self.ecotax_line_ids:
|
||||
ecotax_cls_vals.append(
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"classification_id": ecotaxline.classification_id.id,
|
||||
"force_amount_unit": ecotaxline.force_amount_unit,
|
||||
},
|
||||
)
|
||||
)
|
||||
res["ecotax_line_ids"] = ecotax_cls_vals
|
||||
return res
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
# © 2014-2023 Akretion (http://www.akretion.com)
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class SaleOrderLineEcotaxe(models.Model):
|
||||
_name = "sale.order.line.ecotax"
|
||||
_inherit = "ecotax.line.mixin"
|
||||
_description = "Sale order line ecotax"
|
||||
|
||||
sale_order_line_id = fields.Many2one(
|
||||
comodel_name="sale.order.line",
|
||||
string="Sale line",
|
||||
required=True,
|
||||
readonly=True,
|
||||
index=True,
|
||||
auto_join=True,
|
||||
ondelete="cascade",
|
||||
)
|
||||
product_id = fields.Many2one(
|
||||
"product.product", related="sale_order_line_id.product_id", readonly=True
|
||||
)
|
||||
quantity = fields.Float(related="sale_order_line_id.product_uom_qty", readonly=True)
|
||||
currency_id = fields.Many2one(
|
||||
related="sale_order_line_id.currency_id", readonly=True
|
||||
)
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
* Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
* Florian DA COSTA <florian.dacosta@akretion.com>
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
This module is an extension of the module *l10n_fr_ecotax* for sale orders. Please refer to the README of the module *account_ecotax* for more info about ecotax management.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_ecotax_line_product_sale_readonly,ecotax.line.product readonly,account_ecotax.model_ecotax_line_product,sales_team.group_sale_salesman,1,0,0,0
|
||||
access_account_move_line_ecotax_readonly_sale_user,account.move.line.ecotax readonly sale user,account_ecotax.model_account_move_line_ecotax,sales_team.group_sale_salesman,1,0,0,0
|
||||
ir_model_access_sale_order_line_ecotax_group_sale_salesman,Read Full acess to model_sale_order_line_ecotax to group sale_salesman,model_sale_order_line_ecotax,sales_team.group_sale_salesman,1,1,1,1
|
||||
|
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
|
|
@ -0,0 +1,426 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||
<title>sale Ecotax Management</title>
|
||||
<style type="text/css">
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
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
|
||||
customize this style sheet.
|
||||
*/
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
table.borderless td, table.borderless th {
|
||||
/* Override padding for "table.docutils td" with "! important".
|
||||
The right padding separates the table cells. */
|
||||
padding: 0 0.5em 0 0 ! important }
|
||||
|
||||
.first {
|
||||
/* Override more specific margin styles with "! important". */
|
||||
margin-top: 0 ! important }
|
||||
|
||||
.last, .with-subtitle {
|
||||
margin-bottom: 0 ! important }
|
||||
|
||||
.hidden {
|
||||
display: none }
|
||||
|
||||
.subscript {
|
||||
vertical-align: sub;
|
||||
font-size: smaller }
|
||||
|
||||
.superscript {
|
||||
vertical-align: super;
|
||||
font-size: smaller }
|
||||
|
||||
a.toc-backref {
|
||||
text-decoration: none ;
|
||||
color: black }
|
||||
|
||||
blockquote.epigraph {
|
||||
margin: 2em 5em ; }
|
||||
|
||||
dl.docutils dd {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||
dl.docutils dt {
|
||||
font-weight: bold }
|
||||
*/
|
||||
|
||||
div.abstract {
|
||||
margin: 2em 5em }
|
||||
|
||||
div.abstract p.topic-title {
|
||||
font-weight: bold ;
|
||||
text-align: center }
|
||||
|
||||
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||
div.hint, div.important, div.note, div.tip, div.warning {
|
||||
margin: 2em ;
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||
div.important p.admonition-title, div.note p.admonition-title,
|
||||
div.tip p.admonition-title {
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||
div.danger p.admonition-title, div.error p.admonition-title,
|
||||
div.warning p.admonition-title, .code .error {
|
||||
color: red ;
|
||||
font-weight: bold ;
|
||||
font-family: sans-serif }
|
||||
|
||||
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||
compound paragraphs.
|
||||
div.compound .compound-first, div.compound .compound-middle {
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
div.compound .compound-last, div.compound .compound-middle {
|
||||
margin-top: 0.5em }
|
||||
*/
|
||||
|
||||
div.dedication {
|
||||
margin: 2em 5em ;
|
||||
text-align: center ;
|
||||
font-style: italic }
|
||||
|
||||
div.dedication p.topic-title {
|
||||
font-weight: bold ;
|
||||
font-style: normal }
|
||||
|
||||
div.figure {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
div.footer, div.header {
|
||||
clear: both;
|
||||
font-size: smaller }
|
||||
|
||||
div.line-block {
|
||||
display: block ;
|
||||
margin-top: 1em ;
|
||||
margin-bottom: 1em }
|
||||
|
||||
div.line-block div.line-block {
|
||||
margin-top: 0 ;
|
||||
margin-bottom: 0 ;
|
||||
margin-left: 1.5em }
|
||||
|
||||
div.sidebar {
|
||||
margin: 0 0 0.5em 1em ;
|
||||
border: medium outset ;
|
||||
padding: 1em ;
|
||||
background-color: #ffffee ;
|
||||
width: 40% ;
|
||||
float: right ;
|
||||
clear: right }
|
||||
|
||||
div.sidebar p.rubric {
|
||||
font-family: sans-serif ;
|
||||
font-size: medium }
|
||||
|
||||
div.system-messages {
|
||||
margin: 5em }
|
||||
|
||||
div.system-messages h1 {
|
||||
color: red }
|
||||
|
||||
div.system-message {
|
||||
border: medium outset ;
|
||||
padding: 1em }
|
||||
|
||||
div.system-message p.system-message-title {
|
||||
color: red ;
|
||||
font-weight: bold }
|
||||
|
||||
div.topic {
|
||||
margin: 2em }
|
||||
|
||||
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||
margin-top: 0.4em }
|
||||
|
||||
h1.title {
|
||||
text-align: center }
|
||||
|
||||
h2.subtitle {
|
||||
text-align: center }
|
||||
|
||||
hr.docutils {
|
||||
width: 75% }
|
||||
|
||||
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||
clear: left ;
|
||||
float: left ;
|
||||
margin-right: 1em }
|
||||
|
||||
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||
clear: right ;
|
||||
float: right ;
|
||||
margin-left: 1em }
|
||||
|
||||
img.align-center, .figure.align-center, object.align-center {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
table.align-center {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.align-left {
|
||||
text-align: left }
|
||||
|
||||
.align-center {
|
||||
clear: both ;
|
||||
text-align: center }
|
||||
|
||||
.align-right {
|
||||
text-align: right }
|
||||
|
||||
/* reset inner alignment in figures */
|
||||
div.align-right {
|
||||
text-align: inherit }
|
||||
|
||||
/* div.align-center * { */
|
||||
/* text-align: left } */
|
||||
|
||||
.align-top {
|
||||
vertical-align: top }
|
||||
|
||||
.align-middle {
|
||||
vertical-align: middle }
|
||||
|
||||
.align-bottom {
|
||||
vertical-align: bottom }
|
||||
|
||||
ol.simple, ul.simple {
|
||||
margin-bottom: 1em }
|
||||
|
||||
ol.arabic {
|
||||
list-style: decimal }
|
||||
|
||||
ol.loweralpha {
|
||||
list-style: lower-alpha }
|
||||
|
||||
ol.upperalpha {
|
||||
list-style: upper-alpha }
|
||||
|
||||
ol.lowerroman {
|
||||
list-style: lower-roman }
|
||||
|
||||
ol.upperroman {
|
||||
list-style: upper-roman }
|
||||
|
||||
p.attribution {
|
||||
text-align: right ;
|
||||
margin-left: 50% }
|
||||
|
||||
p.caption {
|
||||
font-style: italic }
|
||||
|
||||
p.credits {
|
||||
font-style: italic ;
|
||||
font-size: smaller }
|
||||
|
||||
p.label {
|
||||
white-space: nowrap }
|
||||
|
||||
p.rubric {
|
||||
font-weight: bold ;
|
||||
font-size: larger ;
|
||||
color: maroon ;
|
||||
text-align: center }
|
||||
|
||||
p.sidebar-title {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold ;
|
||||
font-size: larger }
|
||||
|
||||
p.sidebar-subtitle {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
p.topic-title {
|
||||
font-weight: bold }
|
||||
|
||||
pre.address {
|
||||
margin-bottom: 0 ;
|
||||
margin-top: 0 ;
|
||||
font: inherit }
|
||||
|
||||
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||
|
||||
span.classifier {
|
||||
font-family: sans-serif ;
|
||||
font-style: oblique }
|
||||
|
||||
span.classifier-delimiter {
|
||||
font-family: sans-serif ;
|
||||
font-weight: bold }
|
||||
|
||||
span.interpreted {
|
||||
font-family: sans-serif }
|
||||
|
||||
span.option {
|
||||
white-space: nowrap }
|
||||
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
/* font-size relative to parent (h1..h6 element) */
|
||||
font-size: 80% }
|
||||
|
||||
table.citation {
|
||||
border-left: solid 1px gray;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docinfo {
|
||||
margin: 2em 4em }
|
||||
|
||||
table.docutils {
|
||||
margin-top: 0.5em ;
|
||||
margin-bottom: 0.5em }
|
||||
|
||||
table.footnote {
|
||||
border-left: solid 1px black;
|
||||
margin-left: 1px }
|
||||
|
||||
table.docutils td, table.docutils th,
|
||||
table.docinfo td, table.docinfo th {
|
||||
padding-left: 0.5em ;
|
||||
padding-right: 0.5em ;
|
||||
vertical-align: top }
|
||||
|
||||
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||
font-weight: bold ;
|
||||
text-align: left ;
|
||||
white-space: nowrap ;
|
||||
padding-left: 0 }
|
||||
|
||||
/* "booktabs" style (no vertical lines) */
|
||||
table.docutils.booktabs {
|
||||
border: 0px;
|
||||
border-top: 2px solid;
|
||||
border-bottom: 2px solid;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
table.docutils.booktabs * {
|
||||
border: 0px;
|
||||
}
|
||||
table.docutils.booktabs th {
|
||||
border-bottom: thin solid;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||
font-size: 100% }
|
||||
|
||||
ul.auto-toc {
|
||||
list-style-type: none }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="document" id="sale-ecotax-management">
|
||||
<h1 class="title">sale Ecotax Management</h1>
|
||||
|
||||
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:074afe29b8a676da4886091b345b213defabcb9d874261a0978e4ea3f4e312dc
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-fiscal-rule/tree/16.0/account_ecotax_sale"><img alt="OCA/account-fiscal-rule" src="https://img.shields.io/badge/github-OCA%2Faccount--fiscal--rule-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-fiscal-rule-16-0/account-fiscal-rule-16-0-account_ecotax_sale"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-fiscal-rule&target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
||||
<p>This module is an extension of the module <em>l10n_fr_ecotax</em> for sale orders. Please refer to the README of the module <em>account_ecotax</em> for more info about ecotax management.</p>
|
||||
<p><strong>Table of contents</strong></p>
|
||||
<div class="contents local topic" id="contents">
|
||||
<ul class="simple">
|
||||
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||
<li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
|
||||
<li><a class="reference internal" href="#maintainers" id="toc-entry-5">Maintainers</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-fiscal-rule/issues">GitHub Issues</a>.
|
||||
In case of trouble, please check there if your issue has already been reported.
|
||||
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||
<a class="reference external" href="https://github.com/OCA/account-fiscal-rule/issues/new?body=module:%20account_ecotax_sale%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||
</div>
|
||||
<div class="section" id="credits">
|
||||
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||
<div class="section" id="authors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Akretion</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="contributors">
|
||||
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
|
||||
<ul class="simple">
|
||||
<li>Mourad EL HADJ MIMOUNE <<a class="reference external" href="mailto:mourad.elhadj.mimoune@akretion.com">mourad.elhadj.mimoune@akretion.com</a>></li>
|
||||
<li>Florian DA COSTA <<a class="reference external" href="mailto:florian.dacosta@akretion.com">florian.dacosta@akretion.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
||||
<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
|
||||
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">maintainers</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> <a class="reference external image-reference" href="https://github.com/florian-dacosta"><img alt="florian-dacosta" src="https://github.com/florian-dacosta.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_sale">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>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
from . import test_sale_ecotax
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
# © 2021-2023 Akretion (http://www.akretion.com)
|
||||
# @author Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo.tests.common import Form
|
||||
|
||||
from odoo.addons.account_ecotax.tests.test_ecotax import TestInvoiceEcotaxCommon
|
||||
|
||||
|
||||
class TestsaleEcotaxCommon(TestInvoiceEcotaxCommon):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.product_a = cls.env["product.product"].create(
|
||||
{
|
||||
"name": "product_a",
|
||||
"uom_id": cls.env.ref("uom.product_uom_unit").id,
|
||||
"weight": 100,
|
||||
"list_price": 200,
|
||||
}
|
||||
)
|
||||
cls.product_b = cls.env["product.product"].create(
|
||||
{
|
||||
"name": "product_b",
|
||||
"uom_id": cls.env.ref("uom.product_uom_unit").id,
|
||||
"list_price": 200,
|
||||
"weight": 400,
|
||||
}
|
||||
)
|
||||
|
||||
cls.product_a.ecotax_line_product_ids = [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
# 2.4
|
||||
"classification_id": cls.ecotax_fixed.id,
|
||||
},
|
||||
)
|
||||
]
|
||||
cls.product_b.ecotax_line_product_ids = [
|
||||
(
|
||||
0,
|
||||
0,
|
||||
{
|
||||
"classification_id": cls.ecotax_weight.id,
|
||||
},
|
||||
)
|
||||
]
|
||||
|
||||
def create_sale_partner(self, partner_id, products_and_qty):
|
||||
sale_form = Form(self.env["sale.order"])
|
||||
sale_form.partner_id = partner_id
|
||||
|
||||
for product, qty in products_and_qty:
|
||||
with sale_form.order_line.new() as line_form:
|
||||
line_form.product_id = product
|
||||
line_form.product_uom_qty = qty
|
||||
|
||||
sale = sale_form.save()
|
||||
|
||||
return sale
|
||||
|
||||
def _test_01_classification_weight_based_ecotax(self):
|
||||
"""Tests with weight based ecotaxs"""
|
||||
# in order to test the correct assignment of weight ecotax
|
||||
# I create a customer sale.
|
||||
partner12 = self.env.ref("base.res_partner_12")
|
||||
self.sale = self.create_sale_partner(
|
||||
partner_id=partner12, products_and_qty=[(self.product_b, 1.0)]
|
||||
)
|
||||
self.assertEqual(self.product_b.ecotax_amount, 16)
|
||||
so_form = Form(self.sale)
|
||||
with so_form.order_line.edit(0) as line:
|
||||
line.product_uom_qty = 3.0
|
||||
so_form.save()
|
||||
self.assertEqual(self.sale.order_line.ecotax_amount_unit, 16)
|
||||
self.assertEqual(self.sale.order_line.subtotal_ecotax, 48)
|
||||
self.assertEqual(self.sale.amount_total, 600)
|
||||
self.assertEqual(self.sale.amount_ecotax, 48)
|
||||
|
||||
def _test_02_classification_ecotax(self):
|
||||
"""Tests multiple lines with mixed ecotaxs"""
|
||||
# in order to test the correct assignment of fixed ecotax and weight ecotax
|
||||
# I create a customer sale.
|
||||
partner12 = self.env.ref("base.res_partner_12")
|
||||
self.sale = self.create_sale_partner(
|
||||
partner_id=partner12,
|
||||
products_and_qty=[(self.product_a, 1.0), (self.product_b, 2.0)],
|
||||
)
|
||||
# I assign a product with fixed ecotaxte to sale line
|
||||
sale_line1 = self.sale.order_line[0]
|
||||
# make sure to have 1 tax and fix tax rate
|
||||
sale_line2 = self.sale.order_line[1]
|
||||
# make sure to have 1 tax and fix tax rate
|
||||
self.assertEqual(self.product_a.ecotax_amount, 5.0)
|
||||
so_form = Form(self.sale)
|
||||
with so_form.order_line.edit(0) as line:
|
||||
line.product_uom_qty = 3.0
|
||||
so_form.save()
|
||||
|
||||
self.assertEqual(sale_line1.ecotax_amount_unit, 5.0)
|
||||
self.assertAlmostEqual(sale_line1.subtotal_ecotax, 15.0)
|
||||
self.assertEqual(sale_line2.ecotax_amount_unit, 16)
|
||||
self.assertEqual(sale_line2.subtotal_ecotax, 32)
|
||||
self.assertEqual(self.sale.amount_total, 1000.0)
|
||||
self.assertEqual(self.sale.amount_ecotax, 47.0)
|
||||
|
||||
|
||||
class TestsaleEcotax(TestsaleEcotaxCommon):
|
||||
def test_01_classification_weight_based_ecotax(self):
|
||||
self._test_01_classification_weight_based_ecotax()
|
||||
|
||||
def test_02_classification_ecotax(self):
|
||||
self._test_02_classification_ecotax()
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!--
|
||||
Copyright (C) 2015-2023 Akretion (http://www.akretion.com/)
|
||||
@author: Mourad EL HADJ MIMOUNE <mourad.elhadj.mimoune@akretion.com>
|
||||
-->
|
||||
<odoo>
|
||||
<record id="view_order_form" model="ir.ui.view">
|
||||
<field name="model">sale.order</field>
|
||||
<field name="inherit_id" ref="sale.view_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="tax_totals" position="after">
|
||||
<field name="amount_ecotax" class="oe_subtotal_footer_separator" />
|
||||
</field>
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/form//field[@name='tax_id']"
|
||||
position="after"
|
||||
>
|
||||
<field name="ecotax_line_ids" colspan="2">
|
||||
<tree editable="bottom">
|
||||
<field name="classification_id" />
|
||||
<field name="force_amount_unit" />
|
||||
<field name="amount_unit" />
|
||||
<field name="amount_total" />
|
||||
</tree>
|
||||
</field>
|
||||
<field name="subtotal_ecotax" />
|
||||
<field name="ecotax_amount_unit" />
|
||||
</xpath>
|
||||
|
||||
<xpath
|
||||
expr="//field[@name='order_line']/tree/field[last()]"
|
||||
position="after"
|
||||
>
|
||||
<field name="subtotal_ecotax" optional="show" />
|
||||
<field name="ecotax_amount_unit" optional="hide" />
|
||||
<button name="edit_ecotax_lines" type="object" string="Ecotax" />
|
||||
<field name="ecotax_line_ids" invisible="1">
|
||||
<!-- This is important to have these fields in view for the computed readonly False ecotax_line_ids field compute well
|
||||
as it acts as an onchange. -->
|
||||
<tree>
|
||||
<field name="classification_id" />
|
||||
<field name="force_amount_unit" />
|
||||
<field name="amount_unit" />
|
||||
<field name="amount_total" />
|
||||
</tree>
|
||||
</field>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_sale_line_ecotax_form" model="ir.ui.view">
|
||||
<field name="name">sale.order.line.ecotax.form</field>
|
||||
<field name="model">sale.order.line</field>
|
||||
<field name="priority" eval="1000" />
|
||||
<field name="arch" type="xml">
|
||||
<form create="false">
|
||||
<sheet>
|
||||
<field name="display_type" invisible="1" />
|
||||
<!--
|
||||
We need the sequence field to be here for new lines to be added at the correct position.
|
||||
TODO: at some point we want to fix this in the framework so that an invisible field is not required.
|
||||
-->
|
||||
<field name="sequence" invisible="1" />
|
||||
<field name="product_uom_category_id" invisible="1" />
|
||||
<group>
|
||||
<group attrs="{'invisible': [('display_type', '!=', False)]}">
|
||||
<field
|
||||
name="product_id"
|
||||
readonly="1"
|
||||
widget="many2one_barcode"
|
||||
/>
|
||||
<field name="product_type" invisible="1" />
|
||||
<field name="invoice_status" invisible="1" />
|
||||
<field name="qty_to_invoice" invisible="1" />
|
||||
<field name="product_uom_qty" readonly="1" />
|
||||
<label
|
||||
for="qty_delivered"
|
||||
string="Delivered"
|
||||
invisible="1"
|
||||
/>
|
||||
<div name="delivered_qty" invisible="1">
|
||||
<field name="qty_delivered" invisible="1" />
|
||||
</div>
|
||||
<label for="qty_invoiced" string="Invoiced" invisible="1" />
|
||||
<div name="invoiced_qty" invisible="1">
|
||||
<field name="qty_invoiced" />
|
||||
</div>
|
||||
<field
|
||||
name="product_packaging_qty"
|
||||
invisible="1"
|
||||
groups="product.group_stock_packaging"
|
||||
/>
|
||||
<field
|
||||
name="product_packaging_id"
|
||||
invisible="1"
|
||||
groups="product.group_stock_packaging"
|
||||
/>
|
||||
<field name="price_unit" />
|
||||
<field
|
||||
name="tax_id"
|
||||
widget="many2many_tags"
|
||||
options="{'no_create': True}"
|
||||
readonly="1"
|
||||
/>
|
||||
<t groups="product.group_discount_per_so_line">
|
||||
<label for="discount" />
|
||||
<div name="discount">
|
||||
<field name="discount" class="oe_inline" /> %
|
||||
</div>
|
||||
</t>
|
||||
<field name="sequence" invisible="1" />
|
||||
</group>
|
||||
</group>
|
||||
<label
|
||||
for="name"
|
||||
string="Description"
|
||||
attrs="{'invisible': [('display_type', '!=', False)]}"
|
||||
/>
|
||||
<label
|
||||
for="name"
|
||||
string="Section Name (eg. Products, Services)"
|
||||
attrs="{'invisible': [('display_type', '!=', 'line_section')]}"
|
||||
/>
|
||||
<label
|
||||
for="name"
|
||||
string="Note"
|
||||
attrs="{'invisible': [('display_type', '!=', 'line_note')]}"
|
||||
/>
|
||||
<field name="name" />
|
||||
<div name="invoice_lines" groups="base.group_no_one" invisible="1">
|
||||
<label for="invoice_lines" />
|
||||
<field name="invoice_lines" />
|
||||
</div>
|
||||
<field name="state" invisible="1" />
|
||||
<field name="company_id" invisible="1" />
|
||||
<notebook>
|
||||
<page string="Ecotax lines" name="ecotax_line">
|
||||
<field
|
||||
name="ecotax_line_ids"
|
||||
nolabel="1"
|
||||
attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}"
|
||||
>
|
||||
<tree editable="bottom">
|
||||
<field name="classification_id" />
|
||||
<field name="force_amount_unit" />
|
||||
<field name="amount_unit" />
|
||||
<field name="amount_total" sum="Total Ecotax" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
<group>
|
||||
<field name="price_subtotal" string="Subtotal" />
|
||||
<field name="price_total" string="Total" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
# Architecture
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
U[Users] -->|HTTP| V[Views and QWeb Templates]
|
||||
V --> C[Controllers]
|
||||
V --> W[Wizards – Transient Models]
|
||||
C --> M[Models and ORM]
|
||||
W --> M
|
||||
M --> R[Reports]
|
||||
DX[Data XML] --> M
|
||||
S[Security – ACLs and Groups] -. enforces .-> M
|
||||
|
||||
subgraph Account_ecotax_sale Module - account_ecotax_sale
|
||||
direction LR
|
||||
M:::layer
|
||||
W:::layer
|
||||
C:::layer
|
||||
V:::layer
|
||||
R:::layer
|
||||
S:::layer
|
||||
DX:::layer
|
||||
end
|
||||
|
||||
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
|
||||
```
|
||||
|
||||
Notes
|
||||
- Views include tree/form/kanban templates and report templates.
|
||||
- Controllers provide website/portal routes when present.
|
||||
- Wizards are UI flows implemented with `models.TransientModel`.
|
||||
- Data XML loads data/demo records; Security defines groups and access.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Configuration
|
||||
|
||||
Refer to Odoo settings for account_ecotax_sale. Configure related models, access rights, and options as needed.
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Controllers
|
||||
|
||||
This module does not define custom HTTP controllers.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Dependencies
|
||||
|
||||
This addon depends on:
|
||||
|
||||
- [account_ecotax](../../odoo-bringout-oca-account-fiscal-rule-account_ecotax)
|
||||
- [sale](../../odoo-bringout-oca-ocb-sale)
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
# FAQ
|
||||
|
||||
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
|
||||
- Q: How to enable? A: Start server with --addon account_ecotax_sale or install in UI.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Install
|
||||
|
||||
```bash
|
||||
pip install odoo-bringout-oca-account-fiscal-rule-account_ecotax_sale"
|
||||
# or
|
||||
uv pip install odoo-bringout-oca-account-fiscal-rule-account_ecotax_sale"
|
||||
```
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
# Models
|
||||
|
||||
Detected core models and extensions in account_ecotax_sale.
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class sale_order_line_ecotax
|
||||
class ecotax_line_mixin
|
||||
class sale_order
|
||||
class sale_order_line
|
||||
```
|
||||
|
||||
Notes
|
||||
- Classes show model technical names; fields omitted for brevity.
|
||||
- Items listed under _inherit are extensions of existing models.
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# Overview
|
||||
|
||||
Packaged Odoo addon: account_ecotax_sale. Provides features documented in upstream Odoo 16 under this addon.
|
||||
|
||||
- Source: OCA/OCB 16.0, addon account_ecotax_sale
|
||||
- License: LGPL-3
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Reports
|
||||
|
||||
This module does not define custom reports.
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
# Security
|
||||
|
||||
Access control and security definitions in account_ecotax_sale.
|
||||
|
||||
## Access Control Lists (ACLs)
|
||||
|
||||
Model access permissions defined in:
|
||||
- **[ir.model.access.csv](../account_ecotax_sale/security/ir.model.access.csv)**
|
||||
- 3 model access rules
|
||||
|
||||
## Record Rules
|
||||
|
||||
Row-level security rules defined in:
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Security Layers"
|
||||
A[Users] --> B[Groups]
|
||||
B --> C[Access Control Lists]
|
||||
C --> D[Models]
|
||||
B --> E[Record Rules]
|
||||
E --> F[Individual Records]
|
||||
end
|
||||
```
|
||||
|
||||
Security files overview:
|
||||
- **[ir.model.access.csv](../account_ecotax_sale/security/ir.model.access.csv)**
|
||||
- Model access permissions (CRUD rights)
|
||||
|
||||
Notes
|
||||
- Access Control Lists define which groups can access which models
|
||||
- Record Rules provide row-level security (filter records by user/group)
|
||||
- Security groups organize users and define permission sets
|
||||
- All security is enforced at the ORM level by Odoo
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Troubleshooting
|
||||
|
||||
- Ensure Python and Odoo environment matches repo guidance.
|
||||
- Check database connectivity and logs if startup fails.
|
||||
- Validate that dependent addons listed in DEPENDENCIES.md are installed.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
# Usage
|
||||
|
||||
Start Odoo including this addon (from repo root):
|
||||
|
||||
```bash
|
||||
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon account_ecotax_sale
|
||||
```
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Wizards
|
||||
|
||||
This module does not include UI wizards.
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
[project]
|
||||
name = "odoo-bringout-oca-account-fiscal-rule-account_ecotax_sale"
|
||||
version = "16.0.0"
|
||||
description = "sale Ecotax Management - Sale Ecotaxe"
|
||||
authors = [
|
||||
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
|
||||
]
|
||||
dependencies = [
|
||||
"odoo-bringout-oca-account-fiscal-rule-account_ecotax>=16.0.0",
|
||||
"odoo-bringout-oca-ocb-sale>=16.0.0",
|
||||
"requests>=2.25.1"
|
||||
]
|
||||
readme = "README.md"
|
||||
requires-python = ">= 3.11"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Topic :: Office/Business",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/bringout/0"
|
||||
repository = "https://github.com/bringout/0"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.metadata]
|
||||
allow-direct-references = true
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["account_ecotax_sale"]
|
||||
|
||||
[tool.rye]
|
||||
managed = true
|
||||
dev-dependencies = [
|
||||
"pytest>=8.4.1",
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue