first commit

This commit is contained in:
root
2026-03-14 09:42:12 +00:00
commit 0adbd20c2c
10991 changed files with 1646955 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Pare"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: el preu unitari del pare"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Übergeordnet (Preiskonditionsschema)"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: Der Einzelpreis des übergeordneten Preiskonditionsschemas"

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Padre"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: precio unitario del padre"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Ülem"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- ülem_ühiku_hind: ühiku_hind ülemalt"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "مرجع"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Parent"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: le prix unitaire du parent"

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Fölérendelt"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: a fölérendelt árlista egységára"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Induk"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Padre"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: il prezzo unitario dal padre"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Bovenliggend niveau"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: de eenheidsprijs van het bovenliggend niveau"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Pai"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: o preço unitário do pai"

View File

@@ -0,0 +1,15 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr "Parinte"
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""
"\n"
"- parent_unit_price: unit_price de la părinte"

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,13 @@
#
msgid ""
msgstr "Content-Type: text/plain; charset=utf-8\n"
msgctxt "field:product.price_list,parent:"
msgid "Parent"
msgstr ""
msgctxt "help:product.price_list.line,formula:"
msgid ""
"\n"
"- parent_unit_price: the unit_price from the parent"
msgstr ""

View File

@@ -0,0 +1,33 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.model import fields, tree
from trytond.modules.product_price_list.price_list import Null
from trytond.pool import PoolMeta
class PriceList(tree(), metaclass=PoolMeta):
__name__ = 'product.price_list'
parent = fields.Many2One('product.price_list', "Parent")
def get_context_formula(self, product, quantity, uom, pattern=None):
context = super().get_context_formula(
product, quantity, uom, pattern=pattern)
if self.parent:
parent_unit_price = self.parent.compute(
product, quantity, uom, pattern=pattern)
if parent_unit_price is None:
parent_unit_price = Null()
context['names']['parent_unit_price'] = parent_unit_price
return context
class PriceListLine(metaclass=PoolMeta):
__name__ = 'product.price_list.line'
@classmethod
def __setup__(cls):
super().__setup__()
cls.formula.help += (
'\n- parent_unit_price: the unit_price from the parent')

View File

@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<record model="ir.ui.view" id="product_price_list_view_form">
<field name="model">product.price_list</field>
<field name="inherit" ref="product_price_list.price_list_view_form"/>
<field name="name">product_price_list_form</field>
</record>
</data>
</tryton>

View File

@@ -0,0 +1,2 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.

View File

@@ -0,0 +1,64 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from decimal import Decimal
from trytond.modules.company.tests import (
CompanyTestMixin, create_company, set_company)
from trytond.pool import Pool
from trytond.tests.test_tryton import ModuleTestCase, with_transaction
class ProductPriceListParentTestCase(CompanyTestMixin, ModuleTestCase):
'Test Product Price List Parent module'
module = 'product_price_list_parent'
@with_transaction()
def test_price_list_parent(self):
"Test price list with parent"
pool = Pool()
Template = pool.get('product.template')
Product = pool.get('product.product')
Uom = pool.get('product.uom')
PriceList = pool.get('product.price_list')
company = create_company()
with set_company(company):
unit, = Uom.search([('name', '=', "Unit")])
template = Template(
name="Template", list_price=Decimal(10), default_uom=unit)
template.save()
product = Product(template=template)
product.save()
price_list_parent, = PriceList.create([{
'name': "Parent",
'price': 'list_price',
'lines': [('create', [{
'formula': 'unit_price * 2',
}])],
}])
price_list, = PriceList.create([{
'name': "List",
'parent': price_list_parent.id,
'lines': [('create', [{
'formula': 'parent_unit_price * 2',
}])],
}])
self.assertEqual(
price_list.compute(product, 1, unit), Decimal('40'))
@with_transaction()
def test_line_formula_help(self):
"Test help of line formula"
pool = Pool()
PriceListLine = pool.get('product.price_list.line')
fields = PriceListLine.fields_get(['formula'])
self.assertIn('parent_unit_price', fields['formula']['help'])
del ModuleTestCase

View File

@@ -0,0 +1,12 @@
[tryton]
version=7.8.0
depends:
ir
product_price_list
xml:
product.xml
[register]
model:
product.PriceList
product.PriceListLine

View File

@@ -0,0 +1,9 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<data>
<xpath expr="//field[@name='company']" position="after">
<label name="parent"/>
<field name="parent"/>
</xpath>
</data>