summaryrefslogtreecommitdiff
path: root/addons/l10n_mx
diff options
context:
space:
mode:
authorLaurent Smet <las@odoo.com>2020-04-17 07:43:33 +0000
committerLaurent Smet <las@odoo.com>2020-06-15 08:36:04 +0000
commitbeccf82e09d536255d9d9cb9bfe58ebae2559843 (patch)
treee031e879cb607248f437acc351540324c2f27b31 /addons/l10n_mx
parentf074772d259656a08376bd0519e5648997e700ba (diff)
[REF] account: journal items reconciliation (part 1/2)
This commits refactors the code of the reconciliation, in order to facilitate the process of complex use cases, namely multi-currencies or cash-basis-taxes related (see details below). It also prepares the code for a second refactoring where we will save on each journal items the amount_currency and currency_id field (even in case of operation made in company currency), also in the sake of simplification. 1) Multi-currencies: - the account.partial.reconcile model now will have dedicated columns to specify the amount of the partial reconciliation in the debit_line_id currency and the credit_line_id currency. That comes in handy when dealing with journal items having different secondary currencies, but also allows some simplification. - residual_amount_currency computation changed accordingly - moved models account.full.reconcile and account.partial.reconcile in their dedicated .py file 2) Cash basis taxes - cash basis entries now handle correctly rounding errors to make sure the exact amount of gets reported when the reconciliation becomes full. - the account for the base amount of cash basis entries has to be set, now, on the company instead of on each cash basis tax. - that new 'property' field can be set at the CoA installation via the field property_cash_basis_base_account_id of account.chart.template, or going through the accounting settings. Was task task: 2243420 Was PR #50308 Related: odoo/upgrade#1121 Related: odoo/enterprise#10252 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Diffstat (limited to 'addons/l10n_mx')
-rw-r--r--addons/l10n_mx/data/account_tax_data.xml8
-rw-r--r--addons/l10n_mx/data/l10n_mx_chart_post_data.xml1
2 files changed, 1 insertions, 8 deletions
diff --git a/addons/l10n_mx/data/account_tax_data.xml b/addons/l10n_mx/data/account_tax_data.xml
index 8d91bba6cce..0b3280f6ee3 100644
--- a/addons/l10n_mx/data/account_tax_data.xml
+++ b/addons/l10n_mx/data/account_tax_data.xml
@@ -70,7 +70,6 @@
<field name="type_tax_use">sale</field>
<field name="tax_group_id" ref="tax_group_iva_0"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta209_01"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -110,7 +109,6 @@
<field name="type_tax_use">sale</field>
<field name="tax_group_id" ref="tax_group_iva_16"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta209_01"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -150,7 +148,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_ret_4"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta216_10"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -190,7 +187,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_ret_10"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta216_10"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -300,7 +296,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_ret_1067"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta216_10"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -340,7 +335,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_ret_1067"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta216_10"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -380,7 +374,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_0"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta119_01"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
@@ -418,7 +411,6 @@
<field name="type_tax_use">purchase</field>
<field name="tax_group_id" ref="tax_group_iva_16"/>
<field name="tax_exigibility">on_payment</field>
- <field name="cash_basis_base_account_id" ref="cuenta801_01_99"/>
<field name="cash_basis_transition_account_id" ref="cuenta119_01"/>
<field name="invoice_repartition_line_ids" eval="[(5, 0, 0),
(0,0, {
diff --git a/addons/l10n_mx/data/l10n_mx_chart_post_data.xml b/addons/l10n_mx/data/l10n_mx_chart_post_data.xml
index e95b3a1302f..9acddb7dfe2 100644
--- a/addons/l10n_mx/data/l10n_mx_chart_post_data.xml
+++ b/addons/l10n_mx/data/l10n_mx_chart_post_data.xml
@@ -11,6 +11,7 @@
<field name="property_stock_account_input_categ_id" ref="cuenta205_06_01"/>
<field name="property_stock_account_output_categ_id" ref="cuenta107_05_01"/>
<field name="property_stock_valuation_account_id" ref="cuenta115_01"/>
+ <field name="property_cash_basis_base_account_id" ref="cuenta801_01_99" />
<field name="income_currency_exchange_account_id" ref="cuenta702_01"/>
<field name="expense_currency_exchange_account_id" ref="cuenta701_01"/>
<field name="default_pos_receivable_account_id" ref="cuenta105_02" />