diff --git a/wizard/ranch_purchase_data_invoice_wizardd.py b/wizard/ranch_purchase_data_invoice_wizardd.py index 2c3e0fa61a86591629ea9e23e5e5d5e49040e683..565a2459c7ced47ba47b4cdf4479e2085ff97c30 100644 --- a/wizard/ranch_purchase_data_invoice_wizardd.py +++ b/wizard/ranch_purchase_data_invoice_wizardd.py @@ -195,12 +195,11 @@ class PurchaseDataInvoiceWizard(models.TransientModel): ranch_type = romaneo_rel.romaneo_id.ranch_type price_unit = summary_line.price quantity = summary_line.weight - if summary_line.destiny_id.destiny == 'thrown': - continue - if ranch_type == 'pork': discount = summary_line.discount quantity = summary_line.alive_kilos + if summary_line.destiny_id.destiny == 'thrown': + continue # Include discount of Kilos if discount: @@ -353,14 +352,11 @@ class PurchaseDataInvoiceWizard(models.TransientModel): for src_account, distrib in self.account_distribution.items(): price = round(price_unit*distrib, 2) - if price == 0.0: - continue - account_id, tax_id = mapping_model.get_commision_account( src_account) if not account_id: - account_id = product.property_account_expense or \ + account_id = product.property_account_expense.id or \ product.categ_id.property_account_expense_categ if not tax_id: