From 21bb8884a7bf0e090f62bc6e0cba890809c4d7ac Mon Sep 17 00:00:00 2001 From: Fran Cubero Date: Fri, 26 Jul 2024 16:44:21 +0200 Subject: [PATCH] the old contracts were not migrated --- giscedata_facturacio_comer_som/giscedata_facturacio_report.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/giscedata_facturacio_comer_som/giscedata_facturacio_report.py b/giscedata_facturacio_comer_som/giscedata_facturacio_report.py index c7213c125..628fe5099 100644 --- a/giscedata_facturacio_comer_som/giscedata_facturacio_report.py +++ b/giscedata_facturacio_comer_som/giscedata_facturacio_report.py @@ -83,6 +83,9 @@ def te_autoconsum_collectiu(fact, pol): def te_autoconsum_no_collectiu(fact, pol): if te_autoconsum(fact, pol): + if len(pol.autoconsum_cups_ids) == 0: # old cases not migrated + return True + for cups_autoconsum in pol.autoconsum_cups_ids: if cups_autoconsum.autoconsum_id: if cups_autoconsum.autoconsum_id.collectiu is False: