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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user