From ebb6b6efce8f4d62234ab224ebbe0d170ae99a27 Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 12 May 2025 10:28:04 +0200 Subject: [PATCH] Arbore/arbore#134 add purchase_subtotal_undiscounted --- purchase_subtotal_undiscounted/__init__.py | 1 + .../__manifest__.py | 15 ++++++++++ purchase_subtotal_undiscounted/i18n/es.po | 28 +++++++++++++++++++ purchase_subtotal_undiscounted/i18n/gl_ES.po | 28 +++++++++++++++++++ .../i18n/purchase_subtotal_undiscounted.pot | 26 +++++++++++++++++ .../models/__init__.py | 1 + .../models/purchase_order_line.py | 16 +++++++++++ .../views/purchase_order_line.xml | 15 ++++++++++ 8 files changed, 130 insertions(+) create mode 100644 purchase_subtotal_undiscounted/__init__.py create mode 100644 purchase_subtotal_undiscounted/__manifest__.py create mode 100644 purchase_subtotal_undiscounted/i18n/es.po create mode 100644 purchase_subtotal_undiscounted/i18n/gl_ES.po create mode 100644 purchase_subtotal_undiscounted/i18n/purchase_subtotal_undiscounted.pot create mode 100644 purchase_subtotal_undiscounted/models/__init__.py create mode 100644 purchase_subtotal_undiscounted/models/purchase_order_line.py create mode 100644 purchase_subtotal_undiscounted/views/purchase_order_line.xml diff --git a/purchase_subtotal_undiscounted/__init__.py b/purchase_subtotal_undiscounted/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/purchase_subtotal_undiscounted/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/purchase_subtotal_undiscounted/__manifest__.py b/purchase_subtotal_undiscounted/__manifest__.py new file mode 100644 index 0000000..6c4ff43 --- /dev/null +++ b/purchase_subtotal_undiscounted/__manifest__.py @@ -0,0 +1,15 @@ +{ + "name": "Purchase Subtotal Undiscounted", + "version": "16.0.1.0.0", + "depends": ["purchase_discount"], + "author": "Criptomart", + "category": "Purchases", + "description": "Show subtotal undiscounted in purchase order lines", + "data": [ + "views/purchase_order_line.xml", + ], + "license": "AGPL-3", + "installable": True, + "application": False, + "auto_install": False, +} diff --git a/purchase_subtotal_undiscounted/i18n/es.po b/purchase_subtotal_undiscounted/i18n/es.po new file mode 100644 index 0000000..dac9d54 --- /dev/null +++ b/purchase_subtotal_undiscounted/i18n/es.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_subtotal_undiscounted +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-12 08:22+0000\n" +"PO-Revision-Date: 2025-05-12 10:23+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.6\n" + +#. module: purchase_subtotal_undiscounted +#: model:ir.model,name:purchase_subtotal_undiscounted.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "Línea de pedido de compra" + +#. module: purchase_subtotal_undiscounted +#: model:ir.model.fields,field_description:purchase_subtotal_undiscounted.field_purchase_order_line__price_subtotal_undiscounted +msgid "Subtotal witout Discount" +msgstr "Subtotal sin descuentos" diff --git a/purchase_subtotal_undiscounted/i18n/gl_ES.po b/purchase_subtotal_undiscounted/i18n/gl_ES.po new file mode 100644 index 0000000..482e734 --- /dev/null +++ b/purchase_subtotal_undiscounted/i18n/gl_ES.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_subtotal_undiscounted +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-12 08:22+0000\n" +"PO-Revision-Date: 2025-05-12 10:26+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: gl_ES\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.6\n" + +#. module: purchase_subtotal_undiscounted +#: model:ir.model,name:purchase_subtotal_undiscounted.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "Liña pedido de compra" + +#. module: purchase_subtotal_undiscounted +#: model:ir.model.fields,field_description:purchase_subtotal_undiscounted.field_purchase_order_line__price_subtotal_undiscounted +msgid "Subtotal witout Discount" +msgstr "Subtotal sen Descontos" diff --git a/purchase_subtotal_undiscounted/i18n/purchase_subtotal_undiscounted.pot b/purchase_subtotal_undiscounted/i18n/purchase_subtotal_undiscounted.pot new file mode 100644 index 0000000..bd2f0a0 --- /dev/null +++ b/purchase_subtotal_undiscounted/i18n/purchase_subtotal_undiscounted.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * purchase_subtotal_undiscounted +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-12 08:21+0000\n" +"PO-Revision-Date: 2025-05-12 08:21+0000\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: purchase_subtotal_undiscounted +#: model:ir.model,name:purchase_subtotal_undiscounted.model_purchase_order_line +msgid "Purchase Order Line" +msgstr "" + +#. module: purchase_subtotal_undiscounted +#: model:ir.model.fields,field_description:purchase_subtotal_undiscounted.field_purchase_order_line__price_subtotal_undiscounted +msgid "Subtotal witout Discount" +msgstr "" diff --git a/purchase_subtotal_undiscounted/models/__init__.py b/purchase_subtotal_undiscounted/models/__init__.py new file mode 100644 index 0000000..fa6c0e4 --- /dev/null +++ b/purchase_subtotal_undiscounted/models/__init__.py @@ -0,0 +1 @@ +from . import purchase_order_line diff --git a/purchase_subtotal_undiscounted/models/purchase_order_line.py b/purchase_subtotal_undiscounted/models/purchase_order_line.py new file mode 100644 index 0000000..572efe5 --- /dev/null +++ b/purchase_subtotal_undiscounted/models/purchase_order_line.py @@ -0,0 +1,16 @@ +from odoo import models, fields, api + + +class PurchaseOrderLine(models.Model): + _inherit = "purchase.order.line" + + price_subtotal_undiscounted = fields.Monetary( + string="Subtotal witout Discount", + compute="_compute_price_subtotal_undiscounted", + currency_field="currency_id", + ) + + @api.depends("product_qty", "price_unit") + def _compute_price_subtotal_undiscounted(self): + for line in self: + line.price_subtotal_undiscounted = line.product_qty * line.price_unit diff --git a/purchase_subtotal_undiscounted/views/purchase_order_line.xml b/purchase_subtotal_undiscounted/views/purchase_order_line.xml new file mode 100644 index 0000000..b901cb1 --- /dev/null +++ b/purchase_subtotal_undiscounted/views/purchase_order_line.xml @@ -0,0 +1,15 @@ + + + purchase.order.form.undiscounted + purchase.order + + + + + + + 1 + + + +