Arbore/arbore#134 add purchase_subtotal_undiscounted
This commit is contained in:
parent
08fca37c6d
commit
ebb6b6efce
8 changed files with 130 additions and 0 deletions
1
purchase_subtotal_undiscounted/__init__.py
Normal file
1
purchase_subtotal_undiscounted/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import models
|
||||
15
purchase_subtotal_undiscounted/__manifest__.py
Normal file
15
purchase_subtotal_undiscounted/__manifest__.py
Normal file
|
|
@ -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,
|
||||
}
|
||||
28
purchase_subtotal_undiscounted/i18n/es.po
Normal file
28
purchase_subtotal_undiscounted/i18n/es.po
Normal file
|
|
@ -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"
|
||||
28
purchase_subtotal_undiscounted/i18n/gl_ES.po
Normal file
28
purchase_subtotal_undiscounted/i18n/gl_ES.po
Normal file
|
|
@ -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"
|
||||
|
|
@ -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 ""
|
||||
1
purchase_subtotal_undiscounted/models/__init__.py
Normal file
1
purchase_subtotal_undiscounted/models/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
|||
from . import purchase_order_line
|
||||
16
purchase_subtotal_undiscounted/models/purchase_order_line.py
Normal file
16
purchase_subtotal_undiscounted/models/purchase_order_line.py
Normal file
|
|
@ -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
|
||||
15
purchase_subtotal_undiscounted/views/purchase_order_line.xml
Normal file
15
purchase_subtotal_undiscounted/views/purchase_order_line.xml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<odoo>
|
||||
<record id="view_order_form_inherit_undiscounted" model="ir.ui.view">
|
||||
<field name="name">purchase.order.form.undiscounted</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase_discount.purchase_order_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='order_line']/tree/field[@name='price_subtotal']" position="before">
|
||||
<field name="price_subtotal_undiscounted" optional="show" />
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='order_line']//tree//field[@name='discount']" position="attributes">
|
||||
<attribute name="readonly">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Add table
Add a link
Reference in a new issue