diff --git a/purchase_portal/controllers/prequest_json.py b/purchase_portal/controllers/prequest_json.py index 04ddf2f..4e8f592 100644 --- a/purchase_portal/controllers/prequest_json.py +++ b/purchase_portal/controllers/prequest_json.py @@ -86,8 +86,8 @@ def get_purchase_request_product_table(self, **kw): product_ids = request.env["product.product"].sudo().search([ ("id", "in", product_ids.ids), "|", - ("seller_ids.name", "in", [partner_id.name]), - ("seller_ids.name", "in", [commercial_partner_id.name]) + ("seller_ids.name", "=", partner_id.id), + ("seller_ids.name", "=", commercial_partner_id.id) ]) if request.env.user.banned_product_ids: diff --git a/purchase_portal/models/product_supplierinfo.py b/purchase_portal/models/product_supplierinfo.py index d8c6025..9c19142 100644 --- a/purchase_portal/models/product_supplierinfo.py +++ b/purchase_portal/models/product_supplierinfo.py @@ -34,7 +34,10 @@ class ProductSupplierinfo(models.Model): @api.depends('name') def _compute_seller_children_ids(self): for record in self: - record.seller_children_ids = self.env['res.partner'].search([('parent_id', '=', record.name.id)]) + if record.name: + record.seller_children_ids = self.env['res.partner'].search([('parent_id', '=', record.name.id)]) + else: + record.seller_children_ids = False @api.model def create(self, values): diff --git a/purchase_portal/templates/purchase_request.xml b/purchase_portal/templates/purchase_request.xml index 8355914..1fcc25b 100644 --- a/purchase_portal/templates/purchase_request.xml +++ b/purchase_portal/templates/purchase_request.xml @@ -340,7 +340,7 @@
-
+