Skip to content

Commit

Permalink
Arreglar compute a la hora de añadir proveedores a los productos (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel-Granda1121 authored Jan 13, 2025
1 parent e7866f6 commit 9eb525e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions purchase_portal/controllers/prequest_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion purchase_portal/models/product_supplierinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion purchase_portal/templates/purchase_request.xml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
</span>
</t>
<br t-if="seller.id != product.mapped('seller_ids.name')[-1].id" />
<hr t-if="seller.id != product.mapped('seller_ids.name')[-1].id" />
<!-- <hr t-if="seller.id != product.mapped('seller_ids.name')[-1].id" /> -->
</t>
</t>
</td>
Expand Down

0 comments on commit 9eb525e

Please sign in to comment.