Browse Source
Merge pull request #61 from robinkeunen/9.0-fix-main-supplierinfo
[FIX] beesdoo_product: main supplier info returns single record
pull/62/head
Robin Keunen
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
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): |
|
|