diff --git a/weighing.py b/weighing.py index 0d94585..4d4b806 100644 --- a/weighing.py +++ b/weighing.py @@ -309,6 +309,11 @@ class Weighing(Workflow, ModelSQL, ModelView): if weighing.not_assigned_weight and not weighing.forced_analysis: raise UserError(gettext('agronomics.msg_not_assigned_weight', weighing=weighing.rec_name)) + + if weighing.table and weighing.denomination_origin: + raise UserError(gettext('agronomics.msg_weighing_with_table_do', + weighing=weighing.rec_name)) + product.template = weighing.product product.denominations_of_origin = weighing.denomination_origin if weighing.ecological: @@ -537,10 +542,6 @@ class Weighing(Workflow, ModelSQL, ModelView): if weighing.beneficiaries: Beneficiary.delete([x for x in weighing.beneficiaries]) - if weighing.table and weighing.denomination_origin: - raise UserError(gettext('agronomics.msg_weighing_with_table_do', - weighing=weighing.rec_name)) - parcel = weighing.get_parcel() # Check if all plantations has a parcel in the weighing's crop for plantation in weighing.plantations: