diff --git a/wizard/ranch_purchase_data_invoice_wizardd.py b/wizard/ranch_purchase_data_invoice_wizardd.py
index abd93d2f952ee39547888f6e8568a47d3f183cae..799f55c1871bce7bf44367690e841e4d12cd3cf5 100644
--- a/wizard/ranch_purchase_data_invoice_wizardd.py
+++ b/wizard/ranch_purchase_data_invoice_wizardd.py
@@ -196,7 +196,7 @@ class PurchaseDataInvoiceWizard(models.TransientModel):
             quantity = summary_line.weight
             if ranch_type == 'pork':
                 # TODO: Check if it is valid for cattle, too
-                if summary_line.destiny_code == 'thrown':
+                if summary_line.destiny_id.destiny == 'thrown':
                     continue
                 quantity = summary_line.alive_kilos
             values = {