From 85d3b56eb02810a9c18c7f0d9acbbb4f093367e0 Mon Sep 17 00:00:00 2001 From: jordan <jordan@le-filament.com> Date: Tue, 22 Feb 2022 11:46:13 +0100 Subject: [PATCH] [update] add icon 'star' to show echeance with regul on bordereau --- models/scop_bordereau_cg.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/models/scop_bordereau_cg.py b/models/scop_bordereau_cg.py index 331d265..a5e98b6 100644 --- a/models/scop_bordereau_cg.py +++ b/models/scop_bordereau_cg.py @@ -346,13 +346,19 @@ class Bordereau(models.Model): ' €</td></tr>') detail += "</table><table class='o_group o_inner_group'>" for i in range(1, 5): - amount_echeance = round(sum(self.invoice_ids.filtered( + amount_echeance = round(sum(r.invoice_ids.filtered( lambda inv: inv.cotiz_quarter == i ).mapped('amount_total_signed')), 2) detail += '<tr><td class="o_td_label font-weight-bold">' \ + 'Trimestre ' + str(i) \ + '</td><td style="width: 100%;">' \ - + str(amount_echeance) + ' €</td></tr>' + + str(amount_echeance) + ' €' + is_exo = len(r.invoice_ids.filtered( + lambda inv: inv.cotiz_quarter == i + )) > 1 + if is_exo: + detail += ' ' + '<i class="fa fa-star-o" />' + detail += '</td></tr>' detail += '</table>' r.details = detail -- GitLab