Do not fail to open product category to add products without any categories

(grafted from 72db56e056c39546a146bf57b60246428ed79f6c)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier
2025-07-15 17:42:16 +02:00
parent 94ab53a27f
commit 2c8e0256cd
+2 -2
View File
@@ -32,9 +32,9 @@ class Category(tree(separator=' / '), ModelSQL, ModelView):
@ModelView.button_action('product.act_category_product')
def add_products(cls, categories):
return {
'res_id': [categories[0].id],
'res_id': [categories[0].id if categories else None],
'pyson_domain': PYSONEncoder().encode(
[('id', '=', categories[0].id)]),
[('id', '=', categories[0].id if categories else None)]),
}
@classmethod