Skip to content

Commit

Permalink
[FIX] Avoid weird no profile found error in case we order less produc…
Browse files Browse the repository at this point in the history
…ts than the supplier info min qty
  • Loading branch information
florian-dacosta committed Sep 28, 2023
1 parent 7435db5 commit 2eb6e0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions purchase_edi_file/models/purchase_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ def _get_lines_by_profiles(self, partner):
}
for line in self:
product = line.product_id
seller = product._select_seller(
partner_id=partner, quantity=line.product_uom_qty
)
# the goal of finding the supplierinfo is to get the edi profile
# so we don't need to put the right line quantity, just any supplierinfo
# for this supplier should be enough. (We avoid error in case purchased
# qty is forced to less than the min of supplierinfo
seller = product._select_seller(partner_id=partner, quantity=None)
purchase_edi = seller.purchase_edi_id
# Services should not appear in EDI file unless an EDI profile
# is specifically on the supplier info. This way, we avoid
Expand Down

0 comments on commit 2eb6e0e

Please sign in to comment.