Skip to content

Commit

Permalink
Imp p_main_supplierinfo default sellers for variant
Browse files Browse the repository at this point in the history
If no specific record are found by the first filter. The Odoo default
method will return all active supplier info.
Which will include also supplier info record related to other specific
variant.

With this change if some supplier info related to the product
variant exist, they will be returned instead.
  • Loading branch information
TDu committed May 18, 2022
1 parent 816efdb commit 42ac04a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion product_main_supplierinfo/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ def _get_sellers(self):
)
)
if not sellers:
sellers = all_sellers
sellers = all_sellers.filtered(lambda s: (s.product_id == self))
if not sellers:
sellers = all_sellers
return sellers

0 comments on commit 42ac04a

Please sign in to comment.