From 21f82ffff3ee5f61ec3c5cc3a242218ad0521217 Mon Sep 17 00:00:00 2001
From: benjamin <benjamin@le-filament.com>
Date: Thu, 4 Aug 2022 11:37:27 +0200
Subject: [PATCH] [fix] error compute on update_liasse wizard

---
 views/account_move.xml                        | 5 +----
 wizard/scop_bordereau_update_liasse_wizard.py | 6 +++++-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/views/account_move.xml b/views/account_move.xml
index a27e6b0..14cc305 100644
--- a/views/account_move.xml
+++ b/views/account_move.xml
@@ -33,10 +33,7 @@
                 >
                     <attribute name="invisible">True</attribute>
                 </xpath>
-                <xpath
-                    expr="//header"
-                    position="inside"
-                >
+                <xpath expr="//header" position="inside">
                     <button
                         name="reset_bordereau"
                         type="object"
diff --git a/wizard/scop_bordereau_update_liasse_wizard.py b/wizard/scop_bordereau_update_liasse_wizard.py
index 4f753f1..76ff065 100644
--- a/wizard/scop_bordereau_update_liasse_wizard.py
+++ b/wizard/scop_bordereau_update_liasse_wizard.py
@@ -123,13 +123,17 @@ class ScopBordereauChangeLiasse(models.TransientModel):
                     lambda i: i.type_contribution_id.id == type_cotisation_ur
                 )
                 r.amount_ur_hdf = sum(cotiz_ur_hdf.mapped("amount_total"))
-            # UR Med
+            else:
+                r.amount_ur_hdf = 0
+                # UR Med
             ur_med = self.env.ref("cgscop_partner.riga_14243").id
             if partner.ur_id.id == ur_med:
                 cotiz_ur_med = cotiz.filtered(
                     lambda i: i.type_contribution_id.id == type_cotisation_ur
                 )
                 r.amount_ur_med = sum(cotiz_ur_med.mapped("amount_total"))
+            else:
+                r.amount_ur_med = 0
 
     # ------------------------------------------------------
     # Onchange
-- 
GitLab