details: https://code.tryton.org/tryton/commit/1bd04e7b3df7
branch: default
user: Cédric Krier <[email protected]>
date: Tue Oct 07 18:22:57 2025 +0200
description:
Add the attributes name field to the sale and purchase list views
Closes #14280
diffstat:
modules/product_attribute/product.xml | 14 +++++++++++
modules/product_attribute/setup.py | 8 ++++++
modules/product_attribute/tests/test_module.py | 1 +
modules/product_attribute/tryton.cfg | 3 ++
modules/product_attribute/view/product_list_purchase_line.xml | 9 +++++++
modules/product_attribute/view/product_list_sale_line.xml | 9 +++++++
6 files changed, 44 insertions(+), 0 deletions(-)
diffs (97 lines):
diff -r 2f6936bc0970 -r 1bd04e7b3df7 modules/product_attribute/product.xml
--- a/modules/product_attribute/product.xml Sun Oct 19 10:43:23 2025 +0200
+++ b/modules/product_attribute/product.xml Tue Oct 07 18:22:57 2025 +0200
@@ -130,4 +130,18 @@
<field name="name">product_form</field>
</record>
</data>
+ <data depends="purchase">
+ <record model="ir.ui.view" id="product_view_list_purchase_line">
+ <field name="model">product.product</field>
+ <field name="inherit"
ref="purchase.product_view_list_purchase_line"/>
+ <field name="name">product_list_purchase_line</field>
+ </record>
+ </data>
+ <data depends="sale">
+ <record model="ir.ui.view" id="product_view_list_sale_line">
+ <field name="model">product.product</field>
+ <field name="inherit" ref="sale.product_view_list_sale_line"/>
+ <field name="name">product_list_sale_line</field>
+ </record>
+ </data>
</tryton>
diff -r 2f6936bc0970 -r 1bd04e7b3df7 modules/product_attribute/setup.py
--- a/modules/product_attribute/setup.py Sun Oct 19 10:43:23 2025 +0200
+++ b/modules/product_attribute/setup.py Tue Oct 07 18:22:57 2025 +0200
@@ -50,6 +50,11 @@
requires.append(get_require_version('trytond_%s' % dep))
requires.append(get_require_version('trytond'))
+tests_require = [
+ get_require_version('trytond_purchase'),
+ get_require_version('trytond_sale'),
+ ]
+
setup(name=name,
version=version,
description='Tryton module with product attributes',
@@ -119,6 +124,9 @@
license='GPL-3',
python_requires='>=3.9',
install_requires=requires,
+ extras_require={
+ 'test': tests_require,
+ },
zip_safe=False,
entry_points="""
[trytond.modules]
diff -r 2f6936bc0970 -r 1bd04e7b3df7
modules/product_attribute/tests/test_module.py
--- a/modules/product_attribute/tests/test_module.py Sun Oct 19 10:43:23
2025 +0200
+++ b/modules/product_attribute/tests/test_module.py Tue Oct 07 18:22:57
2025 +0200
@@ -7,6 +7,7 @@
class ProductTestCase(ModuleTestCase):
'Test Product Attribute module'
module = 'product_attribute'
+ extras = ['purchase', 'sale']
del ModuleTestCase
diff -r 2f6936bc0970 -r 1bd04e7b3df7 modules/product_attribute/tryton.cfg
--- a/modules/product_attribute/tryton.cfg Sun Oct 19 10:43:23 2025 +0200
+++ b/modules/product_attribute/tryton.cfg Tue Oct 07 18:22:57 2025 +0200
@@ -3,6 +3,9 @@
depends:
ir
product
+extras_depend:
+ purchase
+ sale
xml:
product.xml
message.xml
diff -r 2f6936bc0970 -r 1bd04e7b3df7
modules/product_attribute/view/product_list_purchase_line.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/product_attribute/view/product_list_purchase_line.xml Tue Oct
07 18:22:57 2025 +0200
@@ -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='name']" position="after">
+ <field name="attributes_name" expand="1" optional="1"/>
+ <field name="attributes" tree_invisible="1"/>
+ </xpath>
+</data>
diff -r 2f6936bc0970 -r 1bd04e7b3df7
modules/product_attribute/view/product_list_sale_line.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/product_attribute/view/product_list_sale_line.xml Tue Oct 07
18:22:57 2025 +0200
@@ -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='name']" position="after">
+ <field name="attributes_name" expand="1" optional="1"/>
+ <field name="attributes" tree_invisible="1"/>
+ </xpath>
+</data>