Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16.0 mig l10n fr ecotaxe sale #449

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions l10n_fr_ecotaxe_sale/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
===================
France sale Ecotaxe
===================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fl10n--france-lightgray.png?logo=github
:target: https://github.com/OCA/l10n-france/tree/15.0/l10n_fr_ecotaxe_sale
:alt: OCA/l10n-france
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/l10n-france-15-0/l10n-france-15-0-l10n_fr_ecotaxe_sale
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/121/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

This module is an extension of the module *l10n_fr_ecotaxe* for sale orders. Please refer to the README of the module *l10n_fr_ecotaxe* for more info about ecotaxe management.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-france/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/l10n-france/issues/new?body=module:%20l10n_fr_ecotaxe_sale%0Aversion:%2015.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 <[email protected]>

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.

This module is part of the `OCA/l10n-france <https://github.com/OCA/l10n-france/tree/15.0/l10n_fr_ecotaxe_sale>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions l10n_fr_ecotaxe_sale/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions l10n_fr_ecotaxe_sale/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# © 2014-2023 Akretion (http://www.akretion.com)
# @author Mourad EL HADJ MIMOUNE <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "France sale Ecotaxe",
"summary": "Sale Ecotaxe used in French localisation contexte",
"version": "16.0.1.0.0",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-france",
"category": "Localization/Account Taxes",
"license": "AGPL-3",
"depends": ["l10n_fr_ecotaxe", "sale"],
"data": ["views/sale_view.xml"],
"installable": True,
}
42 changes: 42 additions & 0 deletions l10n_fr_ecotaxe_sale/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: l10n_fr_ecotaxe_sale
#: model:ir.model.fields,field_description:l10n_fr_ecotaxe_sale.field_sale_order__amount_ecotaxe
msgid "Included Ecotaxe"
msgstr "Ecotaxe Incluse"

#. module: l10n_fr_ecotaxe_sale
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"

#. module: l10n_fr_ecotaxe_sale
#: model:ir.model,name:l10n_fr_ecotaxe_sale.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de bons de commande"

#. 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 "Sous-total Ecotaxe"

#. 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 "Ecotaxe par Unité"
39 changes: 39 additions & 0 deletions l10n_fr_ecotaxe_sale/i18n/l10n_fr_ecotaxe_sale.pot
Original file line number Diff line number Diff line change
@@ -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 ""
1 change: 1 addition & 0 deletions l10n_fr_ecotaxe_sale/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale
44 changes: 44 additions & 0 deletions l10n_fr_ecotaxe_sale/models/sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# © 2015 -2023 Akretion (http://www.akretion.com)
# @author Mourad EL HADJ MIMOUNE <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, fields, models


class SaleOrderLine(models.Model):

_inherit = "sale.order.line"

subtotal_ecotaxe = fields.Float(store=True, compute="_compute_ecotaxe")
unit_ecotaxe_amount = fields.Float(
string="ecotaxe Unit.",
store=True,
compute="_compute_ecotaxe",
)

@api.depends("product_id", "product_uom_qty")
def _compute_ecotaxe(self):
for line in self:
line.unit_ecotaxe_amount = line.product_id.ecotaxe_amount

if line.order_id.pricelist_id:
cur = line.order_id.pricelist_id.currency_id
line.unit_ecotaxe_amount = cur.round(line.unit_ecotaxe_amount)
line.subtotal_ecotaxe = line.unit_ecotaxe_amount * line.product_uom_qty


class SaleOrder(models.Model):

_inherit = "sale.order"

amount_ecotaxe = fields.Float(
string="Included Ecotaxe", store=True, compute="_compute_ecotaxe"
)

@api.depends("order_line.subtotal_ecotaxe")
def _compute_ecotaxe(self):
for order in self:
val_ecotaxe = 0.0
for line in order.order_line:
val_ecotaxe += line.subtotal_ecotaxe
order.amount_ecotaxe = val_ecotaxe
1 change: 1 addition & 0 deletions l10n_fr_ecotaxe_sale/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Mourad EL HADJ MIMOUNE <[email protected]>
1 change: 1 addition & 0 deletions l10n_fr_ecotaxe_sale/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module is an extension of the module *l10n_fr_ecotaxe* for sale orders. Please refer to the README of the module *l10n_fr_ecotaxe* for more info about ecotaxe management.
Binary file added l10n_fr_ecotaxe_sale/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading