mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
Merge pull request #260 from ursais/11.0-subcateg
[IMP] Products in subcategories are equivalents and can be excluded
This commit is contained in:
@@ -13,7 +13,7 @@ class ProductProduct(models.Model):
|
||||
category_id = self.browse(
|
||||
self._context.get('nonequivalent_product_id')).categ_id
|
||||
recs = self.search(
|
||||
[('categ_id', '=', category_id.id),
|
||||
[('categ_id', 'child_of', category_id.id),
|
||||
('id', '!=', self._context.get('nonequivalent_product_id')),
|
||||
('name', operator, name)] + args, limit=limit)
|
||||
if not recs:
|
||||
@@ -30,9 +30,9 @@ class ProductProduct(models.Model):
|
||||
category_id = self.browse(
|
||||
self._context.get('nonequivalent_product_id')).categ_id
|
||||
domain +=\
|
||||
[('categ_id', '=', category_id.id),
|
||||
[('categ_id', 'child_of', category_id.id),
|
||||
('id', '!=', self._context.get('nonequivalent_product_id'))]
|
||||
order = order or self.priority
|
||||
order = order or self.product_tmpl_id.priority
|
||||
return super(ProductProduct, self).search_read(domain=domain,
|
||||
fields=fields,
|
||||
offset=offset,
|
||||
|
||||
Reference in New Issue
Block a user