From 5cd98157f476c08f81f27fca7341c60ad7d8eeed Mon Sep 17 00:00:00 2001
From: titus <22006titus@gmail.com>
Date: Thu, 15 Jun 2023 15:22:51 +0700
Subject: [PATCH] ss[MIG] account_payment_multi_deduction: Migration to 16.0
---
.../__manifest__.py | 2 +-
.../wizard/account_payment_register.py | 14 +-
.../wizard/account_payment_register_views.xml | 145 +++++++++---------
3 files changed, 85 insertions(+), 76 deletions(-)
diff --git a/account_payment_multi_deduction/__manifest__.py b/account_payment_multi_deduction/__manifest__.py
index daace4af46f7..a23045303e82 100644
--- a/account_payment_multi_deduction/__manifest__.py
+++ b/account_payment_multi_deduction/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Payment Register with Multiple Deduction",
- "version": "15.0.1.0.0",
+ "version": "16.0.1.0.0",
"author": "Ecosoft, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/account-payment",
diff --git a/account_payment_multi_deduction/wizard/account_payment_register.py b/account_payment_multi_deduction/wizard/account_payment_register.py
index 5494839be59c..8330b51ed77e 100644
--- a/account_payment_multi_deduction/wizard/account_payment_register.py
+++ b/account_payment_multi_deduction/wizard/account_payment_register.py
@@ -47,7 +47,12 @@ def _compute_default_analytic(self):
active_ids = self.env.context.get("active_ids")
moves = self.env["account.move"].browse(active_ids)
move_lines = moves.mapped("line_ids")
- analytic_account = move_lines.mapped("analytic_account_id")
+ analytic_account = (
+ move_lines.mapped("analytic_account_id")
+ if "analytic_account_id" in move_lines._fields
+ else self.env["account.analytic.account"]
+ )
+
analytic_tag = move_lines.mapped("analytic_tag_ids")
taxes_account = (
self.env["account.tax.repartition.line"]
@@ -71,7 +76,12 @@ def _compute_default_analytic(self):
def _update_vals_deduction(self, moves):
move_lines = moves.mapped("line_ids")
- analytic_account = move_lines.mapped("analytic_account_id")
+ analytic_account = (
+ move_lines.mapped("analytic_account_id")
+ if "analytic_account_id" in move_lines._fields
+ else self.env["account.analytic.account"]
+ )
+
analytic_tag = move_lines.mapped("analytic_tag_ids")
taxes_account = (
self.env["account.tax.repartition.line"]
diff --git a/account_payment_multi_deduction/wizard/account_payment_register_views.xml b/account_payment_multi_deduction/wizard/account_payment_register_views.xml
index 8cd0e1e8c4d9..1f453b10bc38 100644
--- a/account_payment_multi_deduction/wizard/account_payment_register_views.xml
+++ b/account_payment_multi_deduction/wizard/account_payment_register_views.xml
@@ -3,83 +3,82 @@
account.payment.register.form
account.payment.register
-
-
-
-
-
- {'invisible': [('payment_difference_handling','!=','reconcile')]}
-
-
-
+
+
+
+
+
+
+
-
-
-
- {'invisible': [('payment_difference_handling','!=','reconcile')]}
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+