Browse Source

[FIX] beesdoo_product: main supplier info returns single record

pull/61/head
robin.keunen 6 years ago
parent
commit
4d7de162e9
  1. 8
      beesdoo_product/models/beesdoo_product.py

8
beesdoo_product/models/beesdoo_product.py

@ -51,7 +51,13 @@ class BeesdooProduct(models.Model):
product.scale_sale_unit = 'P' product.scale_sale_unit = 'P'
def _get_main_supplier_info(self): def _get_main_supplier_info(self):
return self.seller_ids.sorted(key=lambda seller: seller.date_start, reverse=True)
suppliers = self.seller_ids.sorted(
key=lambda seller: seller.date_start,
reverse=True)
if suppliers:
return suppliers[0]
else:
return suppliers
@api.one @api.one
def generate_barcode(self): def generate_barcode(self):

Loading…
Cancel
Save