From 14c9a149a12d2a5f552287283a1852081ed3b08c Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Fri, 4 Jun 2021 11:12:14 +0200 Subject: [PATCH 1/2] FIX l10n_it_fatturapa: fix demo data to select existing accounts Demo data can be loaded when either l10n_generic_coa and l10n_it CoA are present (or both even), depending on module install order. We look for both, l10n_it first. Failing that, we search for suitable accounts (ignoring their names). --- .../demo/account_invoice_fatturapa.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml b/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml index aa347f7b1b3c..b72778615758 100644 --- a/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml +++ b/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml @@ -17,7 +17,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> @@ -31,7 +31,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> @@ -52,7 +52,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> @@ -66,7 +66,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> @@ -87,7 +87,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_paid'), + 'account_id': ref('l10n_it.1601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_receivable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_assets')], limit=1), }), ]" /> @@ -101,7 +101,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_paid'), + 'account_id': ref('l10n_it.1601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_receivable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_assets')], limit=1), }), ]" /> @@ -123,7 +123,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> @@ -137,7 +137,7 @@ (0,0, { 'factor_percent': 100, 'repartition_type': 'tax', - 'account_id': ref('l10n_generic_coa.tax_received'), + 'account_id': ref('l10n_it.2601', raise_if_not_found=False) or ref('l10n_generic_coa.tax_payable', raise_if_not_found=False) or ref('account.account').search([('user_type_id', '=', 'account.data_account_type_current_liabilities')], limit=1), }), ]" /> From 6c4bd683cf6604de1b97acc0da5ce0c3e04f7dbc Mon Sep 17 00:00:00 2001 From: SimoRubi Date: Mon, 12 Jul 2021 14:45:48 +0200 Subject: [PATCH 2/2] [FIX] l10n_it_fatturapa: Compute correct tax for repartition lines of demo taxes --- .../demo/account_invoice_fatturapa.xml | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml b/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml index b72778615758..75b848fb5f79 100644 --- a/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml +++ b/l10n_it_fatturapa/demo/account_invoice_fatturapa.xml @@ -9,6 +9,7 @@ sale @@ -44,6 +46,7 @@ sale @@ -79,6 +83,7 @@ purchase @@ -115,6 +121,7 @@ sale