From bd60a15973ac9ddae0157d6b6d9687be31b333ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 24 Apr 2026 23:31:34 +0200 Subject: [PATCH] Manage products directly on category form Closes #14811 --- modules/account_product/product.xml | 6 ----- .../account_product/view/category_form.xml | 3 +++ .../view/category_product_form.xml | 8 ------- modules/product/CHANGELOG | 1 + modules/product/category.py | 16 +------------ modules/product/category.xml | 23 ------------------- modules/product/view/category_form.xml | 4 +++- .../product/view/category_product_form.xml | 8 ------- 8 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 modules/account_product/view/category_product_form.xml delete mode 100644 modules/product/view/category_product_form.xml diff --git a/modules/account_product/product.xml b/modules/account_product/product.xml index 3c5dde42b5..07cfdbd7bb 100644 --- a/modules/account_product/product.xml +++ b/modules/account_product/product.xml @@ -10,12 +10,6 @@ this repository contains the full copyright notices and license terms. --> category_form - - product.category - - category_product_form - - Not accounting category product.category diff --git a/modules/account_product/view/category_form.xml b/modules/account_product/view/category_form.xml index 65a7607431..3ae8a0fcb5 100644 --- a/modules/account_product/view/category_form.xml +++ b/modules/account_product/view/category_form.xml @@ -27,5 +27,8 @@ this repository contains the full copyright notices and license terms. --> + + + diff --git a/modules/account_product/view/category_product_form.xml b/modules/account_product/view/category_product_form.xml deleted file mode 100644 index 9801eede48..0000000000 --- a/modules/account_product/view/category_product_form.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - diff --git a/modules/product/CHANGELOG b/modules/product/CHANGELOG index cf43017d5f..f3c9fcd5cb 100644 --- a/modules/product/CHANGELOG +++ b/modules/product/CHANGELOG @@ -1,3 +1,4 @@ +* Manage products directly on category form Version 8.0.0 - 2026-04-20 -------------------------- diff --git a/modules/product/category.py b/modules/product/category.py index ae639b54ea..e354b29d1c 100644 --- a/modules/product/category.py +++ b/modules/product/category.py @@ -7,7 +7,7 @@ from sql.operators import Equal from trytond.model import Exclude, ModelSQL, ModelView, fields, tree from trytond.pool import Pool -from trytond.pyson import Eval, PYSONEncoder +from trytond.pyson import Eval from trytond.tools import is_full_text, lstrip_wildcard @@ -41,11 +41,6 @@ class Category(tree(separator=' / '), ModelSQL, ModelView): 'product.msg_category_code_unique'), ] cls._order.insert(0, ('name', 'ASC')) - cls._buttons.update({ - 'add_products': { - 'icon': 'tryton-add', - }, - }) @classmethod def default_code_readonly(cls): @@ -80,15 +75,6 @@ class Category(tree(separator=' / '), ModelSQL, ModelView): ('code', operator, code_value, *extra), ] - @classmethod - @ModelView.button_action('product.act_category_product') - def add_products(cls, categories): - return { - 'res_id': [categories[0].id if categories else None], - 'pyson_domain': PYSONEncoder().encode( - [('id', '=', categories[0].id if categories else None)]), - } - @classmethod def _code_sequence(cls): pool = Pool() diff --git a/modules/product/category.xml b/modules/product/category.xml index 52c2fa294e..f7b0dcfe73 100644 --- a/modules/product/category.xml +++ b/modules/product/category.xml @@ -22,13 +22,6 @@ this repository contains the full copyright notices and license terms. --> category_form - - product.category - form - - category_product_form - - Categories product.category @@ -71,22 +64,6 @@ this repository contains the full copyright notices and license terms. --> sequence="10" id="menu_category_list"/> - - Add products - product.category - - - - - - - - - product.category - add_products - Add products - - product.category diff --git a/modules/product/view/category_form.xml b/modules/product/view/category_form.xml index 955f9d3c9e..b9d6fb2ec9 100644 --- a/modules/product/view/category_form.xml +++ b/modules/product/view/category_form.xml @@ -13,10 +13,12 @@ this repository contains the full copyright notices and license terms. -->