From b1eb229b907aa2853dc11b362a5f85ef4661dc42 Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Tue, 24 Oct 2023 21:08:55 +0200 Subject: [PATCH] [IMP][12.0] account_fiscal_year_closing do not split by partner account of type not in receivable or payable --- .../models/account_fiscalyear_closing.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/account_fiscal_year_closing/models/account_fiscalyear_closing.py b/account_fiscal_year_closing/models/account_fiscalyear_closing.py index 5baab21a866..c325c364702 100644 --- a/account_fiscal_year_closing/models/account_fiscalyear_closing.py +++ b/account_fiscal_year_closing/models/account_fiscalyear_closing.py @@ -472,7 +472,10 @@ def _mapping_move_lines_get(self): for account in src_accounts: closing_type = self.closing_type_get(account) balance = False - if closing_type == 'balance': + if closing_type == 'balance' or ( + closing_type == 'unreconciled' and + account.internal_type not in ["receivable", "payable"] + ): # Get all lines lines = account_map.account_lines_get(account) balance, move_line = account_map.move_line_prepare( @@ -480,7 +483,8 @@ def _mapping_move_lines_get(self): ) if move_line: move_lines.append(move_line) - elif closing_type == 'unreconciled': + elif closing_type == 'unreconciled' and \ + account.internal_type in ["receivable", "payable"]: # Get credit and debit grouping by partner partners = account_map.account_partners_get(account) for partner in partners: