[FIX] purchase_stock: RFQ automatically created with an inactive vendor

Steps to reproduce the bug:
- Let's consider the storable product P and the vendor V
- Set V as a supplier of P
- Archive V
- Go to product P and click on button "Replenish"

Bug:

A RFQ was created with the vendor V

Fine tuning of https://github.com/odoo/odoo/commit/5040c17e873b8476c754f1f3e1686c2a02b36e48

opw:2066616

closes odoo/odoo#37285

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit is contained in:
fw-bot
2019-09-23 13:42:31 +00:00
committed by Goffin Simon
parent 2efc7b4c67
commit 21f5771773
+1 -2
View File
@@ -614,7 +614,7 @@ class ProductProduct(models.Model):
'target': 'new'}
def _prepare_sellers(self, params):
return self.seller_ids
return self.seller_ids.filtered(lambda s: s.name.active)
@api.multi
def _select_seller(self, partner_id=False, quantity=0.0, date=None, uom_id=False, params=False):
@@ -805,7 +805,6 @@ class SupplierInfo(models.Model):
'res.partner', 'Vendor',
domain=[('supplier', '=', True)], ondelete='cascade', required=True,
help="Vendor of this product")
active = fields.Boolean(related='name.active', readonly=True)
product_name = fields.Char(
'Vendor Product Name',
help="This vendor's product name will be used when printing a request for quotation. Keep empty to use the internal one.")