diff options
| author | Carlos Dauden <carlos.dauden@tecnativa.com> | 2020-06-16 11:35:05 +0000 |
|---|---|---|
| committer | Arnold Moyaux <arm@odoo.com> | 2020-06-24 08:44:59 +0000 |
| commit | fdc20d13bb6c4f22bcfcf88384f8a13a2cb4b005 (patch) | |
| tree | e0fe69717e090c9842803d1fec8d763d969b19bd | |
| parent | 6bd8e8976608eb97fc544049a91c456253d6b092 (diff) | |
[FIX] sale_purchase: Take into account minimal quantity supplierinfo
closes odoo/odoo#53548
X-original-commit: d872cbf11f05cd10aa9b36b3c0aded895e0e68f3
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
| -rw-r--r-- | addons/sale_purchase/models/sale_order.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/sale_purchase/models/sale_order.py b/addons/sale_purchase/models/sale_order.py index 36fd34699c7..55055be07a2 100644 --- a/addons/sale_purchase/models/sale_order.py +++ b/addons/sale_purchase/models/sale_order.py @@ -266,8 +266,7 @@ class SaleOrderLine(models.Model): for line in self: line = line.with_company(line.company_id) # determine vendor of the order (take the first matching company and product) - # VFE fixme why isn't the _select_seller function used ??? - suppliers = line.product_id.seller_ids.filtered(lambda vendor: (not vendor.company_id or vendor.company_id == line.company_id) and (not vendor.product_id or vendor.product_id == line.product_id)) + suppliers = line.product_id._select_seller(quantity=line.product_uom_qty, uom_id=line.product_uom) if not suppliers: raise UserError(_("There is no vendor associated to the product %s. Please define a vendor for this product.") % (line.product_id.display_name,)) supplierinfo = suppliers[0] |
