diff --git a/account_reconcile_wizard/README.rst b/account_reconcile_wizard/README.rst new file mode 100644 index 0000000000..1290677002 --- /dev/null +++ b/account_reconcile_wizard/README.rst @@ -0,0 +1,113 @@ +============================= +Account Reconcile from Wizard +============================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:df764d8e6f6d65dec083b4cffc5811c0f9ce62e3b6696dbe23fb7473ee57d38c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github + :target: https://github.com/OCA/account-reconcile/tree/18.0/account_reconcile_wizard + :alt: OCA/account-reconcile +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-reconcile-18-0/account-reconcile-18-0-account_reconcile_wizard + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This addon allows you to reconcile journal items with other journal +items from the same account or another account with the same partner. +When the account is different, a transfer move is created. When there is +a difference between debit and credit, a write-off move is created. + +This module replaces the Reconcile menu and actions of the +account_reconcile_oca module to use a wizard instead of the +reconciliation widget. + +With this feature of transferring from one account to another, this +module can replace the functionality of the ``account_netting`` module. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- Go to Invoicing / Accounting / Reconcile. +- Filter and select the journal items you wish to reconcile. +- A button is displayed in the list view header. +- If the balance is zero, the reconciliation is done automatically. + Otherwise, a popup is displayed to select the write-off account or + allow partial reconciliation. + +Known issues / Roadmap +====================== + +- Allow reconciliation with multiple currencies and partners + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Tecnativa + +Contributors +------------ + +- Tecnativa (https://www.tecnativa.com): + + - Carlos Dauden + - Carlos Lopez + - Pedro M. Baeza + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-carlos-lopez-tecnativa| image:: https://github.com/carlos-lopez-tecnativa.png?size=40px + :target: https://github.com/carlos-lopez-tecnativa + :alt: carlos-lopez-tecnativa + +Current `maintainer `__: + +|maintainer-carlos-lopez-tecnativa| + +This module is part of the `OCA/account-reconcile `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_reconcile_wizard/__init__.py b/account_reconcile_wizard/__init__.py new file mode 100644 index 0000000000..9b4296142f --- /dev/null +++ b/account_reconcile_wizard/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/account_reconcile_wizard/__manifest__.py b/account_reconcile_wizard/__manifest__.py new file mode 100644 index 0000000000..b6433cddc0 --- /dev/null +++ b/account_reconcile_wizard/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Account Reconcile from Wizard", + "version": "18.0.1.0.0", + "license": "AGPL-3", + "author": "Tecnativa,Odoo Community Association (OCA)", + "maintainers": ["carlos-lopez-tecnativa"], + "website": "https://github.com/OCA/account-reconcile", + "depends": ["account_reconcile_oca"], + "data": [ + "security/ir.model.access.csv", + "wizard/account_manual_reconcile_wizard.xml", + "views/account_move_line.xml", + ], +} diff --git a/account_reconcile_wizard/i18n/account_reconcile_wizard.pot b/account_reconcile_wizard/i18n/account_reconcile_wizard.pot new file mode 100644 index 0000000000..478f9c0395 --- /dev/null +++ b/account_reconcile_wizard/i18n/account_reconcile_wizard.pot @@ -0,0 +1,314 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_wizard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-04-28 19:03+0000\n" +"PO-Revision-Date: 2026-04-28 19:03+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__account_id +msgid "Account" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_manual_reconcile_wizard_line +msgid "Account Manual Reconcile Line" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_line_ids +msgid "Add lines for write-offs, adjustments, counterparts, etc." +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "All selected lines must be from the same company." +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__allow_partial_reconcile +msgid "Allow Partial Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__allow_partial_reconcile +msgid "Allow reconciliation even if balances do not match exactly" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__analytic_distribution +msgid "Analytic Distribution" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__analytic_precision +msgid "Analytic Precision" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__balance_difference +msgid "Balance Difference" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Cancel" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Cannot reconcile already reconciled lines." +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__company_id +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__company_id +msgid "Company" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__company_currency_id +msgid "Company Currency" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__create_uid +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__create_uid +msgid "Created by" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__create_date +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__create_date +msgid "Created on" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__credit +msgid "Credit" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__company_currency_id +msgid "Currency" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__date +msgid "Date" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__debit +msgid "Debit" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Debit and credit amounts must be positive." +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__name +msgid "Description" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__display_allow_partial_reconcile +msgid "Display Allow Partial Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__display_name +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__display_name +msgid "Display Name" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__distribution_analytic_account_ids +msgid "Distribution Analytic Account" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__id +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__id +msgid "ID" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__journal_id +msgid "Journal" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_move_line +msgid "Journal Item" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Keep open balance" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_uid +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_date +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_manual_reconcile_wizard +msgid "Manual Reconciliation Wizard" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__move_line_ids +msgid "Move Lines to Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__need_transfer +msgid "Need Transfer" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__need_write_off +msgid "Need Write Off" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.actions.act_window,name:account_reconcile_wizard.account_move_line_reconcile_act_window +#: model:ir.ui.menu,name:account_reconcile_wizard.account_move_line_reconcile_menu +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_move_line_reconcile_list_view +msgid "Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Reconcile & Open" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconcile_model_id +msgid "Reconcile Model" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/models/account_move_line.py:0 +msgid "Reconciliation" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconciliation_account_id +msgid "Reconciliation Account" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Reconciliation Models" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reference +msgid "Reference" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconcile_model_id +msgid "Select a reconciliation model to auto-load lines" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Success" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "The selected lines have been successfully reconciled." +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "The total of write-off lines must balance the difference of %s." +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Total Credit" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Total Debit" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Transfer from %s" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Transfer to %s" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__wizard_id +msgid "Wizard" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_amount +msgid "Write Off Amount" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_line_ids +msgid "Write Off Line" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Write-Off" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "You can only reconcile entries from the same partner." +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "You can only reconcile entries from up to 2 different accounts." +msgstr "" diff --git a/account_reconcile_wizard/i18n/es.po b/account_reconcile_wizard/i18n/es.po new file mode 100644 index 0000000000..ef8eafbefb --- /dev/null +++ b/account_reconcile_wizard/i18n/es.po @@ -0,0 +1,319 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_reconcile_wizard +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-04-28 19:03+0000\n" +"PO-Revision-Date: 2026-04-28 14:11-0500\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.9\n" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__account_id +msgid "Account" +msgstr "Cuenta" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_manual_reconcile_wizard_line +msgid "Account Manual Reconcile Line" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_line_ids +msgid "Add lines for write-offs, adjustments, counterparts, etc." +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "All selected lines must be from the same company." +msgstr "Todas las lineas seleccionadas deben pertenecer a la misma compañía." + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__allow_partial_reconcile +msgid "Allow Partial Reconcile" +msgstr "Permitir conciliación parcial" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__allow_partial_reconcile +msgid "Allow reconciliation even if balances do not match exactly" +msgstr "" +"Permitir la conciliación incluso si los saldos no coinciden exactamente" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__analytic_distribution +msgid "Analytic Distribution" +msgstr "Distribución analítica" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__analytic_precision +msgid "Analytic Precision" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__balance_difference +msgid "Balance Difference" +msgstr "Diferencia de balance" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Cannot reconcile already reconciled lines." +msgstr "No se pueden conciliar las líneas que ya están conciliadas." + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__company_id +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__company_id +msgid "Company" +msgstr "Compañía" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__company_currency_id +msgid "Company Currency" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__create_uid +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__create_uid +msgid "Created by" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__create_date +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__create_date +msgid "Created on" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__credit +msgid "Credit" +msgstr "Haber" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__company_currency_id +msgid "Currency" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__date +msgid "Date" +msgstr "Fecha" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__debit +msgid "Debit" +msgstr "Debe" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Debit and credit amounts must be positive." +msgstr "El debe y haber deben ser positivos" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__name +msgid "Description" +msgstr "Descripción" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__display_allow_partial_reconcile +msgid "Display Allow Partial Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__display_name +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__display_name +msgid "Display Name" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__distribution_analytic_account_ids +msgid "Distribution Analytic Account" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__id +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__id +msgid "ID" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__journal_id +msgid "Journal" +msgstr "Diario" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_move_line +msgid "Journal Item" +msgstr "Apunte contable" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Keep open balance" +msgstr "Mantener el saldo abierto" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_uid +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_date +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__write_date +msgid "Last Updated on" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model,name:account_reconcile_wizard.model_account_manual_reconcile_wizard +msgid "Manual Reconciliation Wizard" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__move_line_ids +msgid "Move Lines to Reconcile" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__need_transfer +msgid "Need Transfer" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__need_write_off +msgid "Need Write Off" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.actions.act_window,name:account_reconcile_wizard.account_move_line_reconcile_act_window +#: model:ir.ui.menu,name:account_reconcile_wizard.account_move_line_reconcile_menu +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_move_line_reconcile_list_view +msgid "Reconcile" +msgstr "Conciliar" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Reconcile & Open" +msgstr "Conciliar y mostrar" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconcile_model_id +msgid "Reconcile Model" +msgstr "Modelo de conciliación" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/models/account_move_line.py:0 +msgid "Reconciliation" +msgstr "Conciliación" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconciliation_account_id +msgid "Reconciliation Account" +msgstr "" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Reconciliation Models" +msgstr "Modelos de conciliación" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__reference +msgid "Reference" +msgstr "Referencia" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,help:account_reconcile_wizard.field_account_manual_reconcile_wizard__reconcile_model_id +msgid "Select a reconciliation model to auto-load lines" +msgstr "" +"Seleccione un modelo de conciliación para cargar automáticamente las líneas" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Success" +msgstr "Éxito" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "The selected lines have been successfully reconciled." +msgstr "Las líneas seleccionadas se han conciliado correctamente." + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "The total of write-off lines must balance the difference of %s." +msgstr "" +"El total de las líneas de cancelación debe equilibrar la diferencia de %s." + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Total Credit" +msgstr "Total haber" + +#. module: account_reconcile_wizard +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Total Debit" +msgstr "Total debe" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Transfer from %s" +msgstr "Transferencia desde %s" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "Transfer to %s" +msgstr "Transferir a %s" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard_line__wizard_id +msgid "Wizard" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_amount +msgid "Write Off Amount" +msgstr "" + +#. module: account_reconcile_wizard +#: model:ir.model.fields,field_description:account_reconcile_wizard.field_account_manual_reconcile_wizard__write_off_line_ids +msgid "Write Off Line" +msgstr "" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +#: model_terms:ir.ui.view,arch_db:account_reconcile_wizard.account_manual_reconcile_wizard_form_view +msgid "Write-Off" +msgstr "Diferencias" + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "You can only reconcile entries from the same partner." +msgstr "Solo se pueden conciliar entradas de la misma empresa." + +#. module: account_reconcile_wizard +#. odoo-python +#: code:addons/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py:0 +msgid "You can only reconcile entries from up to 2 different accounts." +msgstr "Solo se pueden conciliar asientos de hasta 2 cuentas diferentes." diff --git a/account_reconcile_wizard/models/__init__.py b/account_reconcile_wizard/models/__init__.py new file mode 100644 index 0000000000..8795b3bea6 --- /dev/null +++ b/account_reconcile_wizard/models/__init__.py @@ -0,0 +1 @@ +from . import account_move_line diff --git a/account_reconcile_wizard/models/account_move_line.py b/account_reconcile_wizard/models/account_move_line.py new file mode 100644 index 0000000000..cb4fce1618 --- /dev/null +++ b/account_reconcile_wizard/models/account_move_line.py @@ -0,0 +1,23 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + def action_reconcile_manually(self): + # Override the method from account_reconcile_oca + # to open the new wizard instead of the conciliation widget. + wizard = ( + self.env["account.manual.reconcile.wizard"] + .with_context(active_model="account.move.line", active_ids=self.ids) + .create({}) + ) + if not wizard.need_write_off: + wizard.allow_partial_reconcile = True + return wizard.action_reconcile() + return wizard._get_records_action( + target="new", name=self.env._("Reconciliation") + ) diff --git a/account_reconcile_wizard/pyproject.toml b/account_reconcile_wizard/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_reconcile_wizard/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_reconcile_wizard/readme/CONTRIBUTORS.md b/account_reconcile_wizard/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..8ee61f32b3 --- /dev/null +++ b/account_reconcile_wizard/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Tecnativa (): + - Carlos Dauden + - Carlos Lopez + - Pedro M. Baeza \ No newline at end of file diff --git a/account_reconcile_wizard/readme/DESCRIPTION.md b/account_reconcile_wizard/readme/DESCRIPTION.md new file mode 100644 index 0000000000..44ef2eb780 --- /dev/null +++ b/account_reconcile_wizard/readme/DESCRIPTION.md @@ -0,0 +1,7 @@ +This addon allows you to reconcile journal items with other journal items from the same account or another account with the same partner. +When the account is different, a transfer move is created. +When there is a difference between debit and credit, a write-off move is created. + +This module replaces the Reconcile menu and actions of the account_reconcile_oca module to use a wizard instead of the reconciliation widget. + +With this feature of transferring from one account to another, this module can replace the functionality of the `account_netting` module. \ No newline at end of file diff --git a/account_reconcile_wizard/readme/ROADMAP.md b/account_reconcile_wizard/readme/ROADMAP.md new file mode 100644 index 0000000000..21c469c2a7 --- /dev/null +++ b/account_reconcile_wizard/readme/ROADMAP.md @@ -0,0 +1 @@ +- Allow reconciliation with multiple currencies and partners diff --git a/account_reconcile_wizard/readme/USAGE.md b/account_reconcile_wizard/readme/USAGE.md new file mode 100644 index 0000000000..15bdaffc69 --- /dev/null +++ b/account_reconcile_wizard/readme/USAGE.md @@ -0,0 +1,4 @@ +- Go to Invoicing / Accounting / Reconcile. +- Filter and select the journal items you wish to reconcile. +- A button is displayed in the list view header. +- If the balance is zero, the reconciliation is done automatically. Otherwise, a popup is displayed to select the write-off account or allow partial reconciliation. \ No newline at end of file diff --git a/account_reconcile_wizard/security/ir.model.access.csv b/account_reconcile_wizard/security/ir.model.access.csv new file mode 100644 index 0000000000..6490dce486 --- /dev/null +++ b/account_reconcile_wizard/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_account_manual_reconcile_wizard,account.manual.reconcile.wizard,model_account_manual_reconcile_wizard,account.group_account_user,1,1,1,1 +access_account_manual_reconcile_wizard_line,account.manual.reconcile.wizard.line,model_account_manual_reconcile_wizard_line,account.group_account_user,1,1,1,1 diff --git a/account_reconcile_wizard/static/description/icon.png b/account_reconcile_wizard/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/account_reconcile_wizard/static/description/icon.png differ diff --git a/account_reconcile_wizard/static/description/index.html b/account_reconcile_wizard/static/description/index.html new file mode 100644 index 0000000000..e22e078bdd --- /dev/null +++ b/account_reconcile_wizard/static/description/index.html @@ -0,0 +1,457 @@ + + + + + +Account Reconcile from Wizard + + + +
+

Account Reconcile from Wizard

+ + +

Beta License: AGPL-3 OCA/account-reconcile Translate me on Weblate Try me on Runboat

+

This addon allows you to reconcile journal items with other journal +items from the same account or another account with the same partner. +When the account is different, a transfer move is created. When there is +a difference between debit and credit, a write-off move is created.

+

This module replaces the Reconcile menu and actions of the +account_reconcile_oca module to use a wizard instead of the +reconciliation widget.

+

With this feature of transferring from one account to another, this +module can replace the functionality of the account_netting module.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to Invoicing / Accounting / Reconcile.
  • +
  • Filter and select the journal items you wish to reconcile.
  • +
  • A button is displayed in the list view header.
  • +
  • If the balance is zero, the reconciliation is done automatically. +Otherwise, a popup is displayed to select the write-off account or +allow partial reconciliation.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Allow reconciliation with multiple currencies and partners
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainer:

+

carlos-lopez-tecnativa

+

This module is part of the OCA/account-reconcile project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/account_reconcile_wizard/tests/__init__.py b/account_reconcile_wizard/tests/__init__.py new file mode 100644 index 0000000000..4b5aa94ef0 --- /dev/null +++ b/account_reconcile_wizard/tests/__init__.py @@ -0,0 +1 @@ +from . import test_account_manual_reconcile_wizard diff --git a/account_reconcile_wizard/tests/test_account_manual_reconcile_wizard.py b/account_reconcile_wizard/tests/test_account_manual_reconcile_wizard.py new file mode 100644 index 0000000000..966b69c267 --- /dev/null +++ b/account_reconcile_wizard/tests/test_account_manual_reconcile_wizard.py @@ -0,0 +1,492 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import Command +from odoo.exceptions import UserError +from odoo.tests import Form, tagged + +from odoo.addons.account.tests.common import AccountTestInvoicingCommon + + +@tagged("post_install", "-at_install") +class TestAccountManualReconcileWizard(AccountTestInvoicingCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.expense_account = cls.company_data["default_account_expense"] + cls.expense_account2 = cls.expense_account.copy() + cls.partner = cls.env["res.partner"].create({"name": "Test Partner"}) + cls.invoice1 = cls._create_invoice_one_line( + price_unit=100.0, + move_type="out_invoice", + partner_id=cls.partner.id, + post=True, + ) + cls.invoice2 = cls._create_invoice_one_line( + price_unit=50.0, + move_type="out_invoice", + partner_id=cls.partner.id, + post=True, + ) + cls.bill1 = cls._create_invoice_one_line( + price_unit=100.0, + move_type="in_invoice", + partner_id=cls.partner.id, + post=True, + ) + cls.bill2 = cls._create_invoice_one_line( + price_unit=150.0, + move_type="in_invoice", + partner_id=cls.partner.id, + post=True, + ) + cls.payment1 = cls.init_payment(100, post=True, partner=cls.partner) + cls.reconcile_model_percentage = cls.env["account.reconcile.model"].create( + { + "name": "Test Reconcile Model", + "rule_type": "writeoff_button", + "counterpart_type": "general", + "line_ids": [ + Command.create( + { + "account_id": cls.expense_account.id, + "amount_type": "percentage", + "amount_string": 60.0, + } + ), + Command.create( + { + "account_id": cls.expense_account2.id, + "amount_type": "percentage", + "amount_string": 40.0, + } + ), + ], + } + ) + + def _create_reconcile_wizard(self, lines): + return ( + self.env["account.manual.reconcile.wizard"] + .with_context(active_model="account.move.line", active_ids=lines.ids) + .create({}) + ) + + def test_reconcile_full(self): + """ + Invoice 1 = 100, Payment 1 = 100. + The difference is 0, so no transfer nor write-off is needed. + Both documents should be fully reconciled. + """ + lines_to_reconcile = ( + self.invoice1.line_ids + self.payment1.move_id.line_ids + ).filtered(lambda line: line.account_id.account_type == "asset_receivable") + self.assertEqual(len(lines_to_reconcile), 2) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertFalse(wizard.need_transfer) + self.assertFalse(wizard.need_write_off) + self.assertTrue(wizard.allow_partial_reconcile) + self.assertTrue(wizard.display_allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 0.0) + result_lines = wizard._action_reconcile() + self.assertEqual(result_lines, lines_to_reconcile) + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + + def test_reconcile_full_with_transfer(self): + """ + Invoice 1 = 100, Bill 1 = 100. + The difference is 0, but with transfer, + 100 is transferred from payable to receivable, so no write-off is needed. + Both documents should be fully reconciled. + """ + lines_to_reconcile = (self.invoice1.line_ids + self.bill1.line_ids).filtered( + lambda line: line.account_id.account_type + in ["asset_receivable", "liability_payable"] + ) + self.assertEqual(len(lines_to_reconcile), 2) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertTrue(wizard.need_transfer) + self.assertFalse(wizard.need_write_off) + self.assertTrue(wizard.allow_partial_reconcile) + self.assertTrue(wizard.display_allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 0.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 4) + new_move_lines = result_lines - lines_to_reconcile + # Check the transfer lines + transfer_origin = new_move_lines.filtered( + lambda line: line.account_id.account_type == "liability_payable" + ) + transfer_dest = new_move_lines.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + self.assertEqual(transfer_origin.debit, 100.0) + self.assertEqual(transfer_dest.credit, 100.0) + # Check the invoices and bill are fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + self.assertEqual(self.bill1.amount_residual, 0.0) + + def test_reconcile_partial_with_transfer_without_write_off_from_payable(self): + """ + Invoice 1 = 100, Invoice 2 = 50, Bill 1 = 100. + The difference is 50, but with partial reconciliation, + only 100 is transferred from payable to receivable, so no write-off is needed. + Invoice 1 should be partially reconciled, + and Invoice 2 and Bill 1 should be fully reconciled. + """ + lines_to_reconcile = ( + self.invoice1.line_ids + self.invoice2.line_ids + self.bill1.line_ids + ).filtered( + lambda line: line.account_id.account_type + in ["asset_receivable", "liability_payable"] + ) + self.assertEqual(len(lines_to_reconcile), 3) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertTrue(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertTrue(wizard.allow_partial_reconcile) + self.assertTrue(wizard.display_allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 50.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 5) + new_move_lines = result_lines - lines_to_reconcile + self.assertEqual(len(new_move_lines), 2) + self.assertEqual(len(new_move_lines.move_id), 1) + self.assertEqual(new_move_lines.move_id.move_type, "entry") + # Check the transfer lines + transfer_origin = new_move_lines.filtered( + lambda line: line.account_id.account_type == "liability_payable" + ) + transfer_dest = new_move_lines.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + self.assertEqual(transfer_origin.debit, 100.0) + self.assertEqual(transfer_dest.credit, 100.0) + # Check the invoices and bill are reconciled as expected + full_reconcile_lines = lines_to_reconcile - self.invoice1.line_ids + self.assertTrue(all(line.reconciled for line in full_reconcile_lines)) + self.assertTrue(full_reconcile_lines.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 50.0) + self.assertEqual(self.invoice2.amount_residual, 0.0) + self.assertEqual(self.bill1.amount_residual, 0.0) + + def test_reconcile_partial_with_transfer_without_write_off_from_receivable(self): + """ + Invoice 1 = 100, Bill 2 = 150. + The difference is -50, but with partial reconciliation, + only 100 is transferred from receivable to payable, so no write-off is needed. + Invoice 1 should be fully reconciled, + and Bill 2 should be partially reconciled. + """ + lines_to_reconcile = (self.invoice1.line_ids + self.bill2.line_ids).filtered( + lambda line: line.account_id.account_type + in ["asset_receivable", "liability_payable"] + ) + self.assertEqual(len(lines_to_reconcile), 2) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertTrue(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertTrue(wizard.allow_partial_reconcile) + self.assertTrue(wizard.display_allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, -50.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 4) + new_move_lines = result_lines - lines_to_reconcile + self.assertEqual(len(new_move_lines), 2) + self.assertEqual(len(new_move_lines.move_id), 1) + self.assertEqual(new_move_lines.move_id.move_type, "entry") + # Check the transfer lines + transfer_origin = new_move_lines.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + transfer_dest = new_move_lines.filtered( + lambda line: line.account_id.account_type == "liability_payable" + ) + self.assertEqual(transfer_origin.credit, 100.0) + self.assertEqual(transfer_dest.debit, 100.0) + # Check the invoices and bill are reconciled as expected + full_reconcile_lines = lines_to_reconcile - self.bill2.line_ids + self.assertTrue(all(line.reconciled for line in full_reconcile_lines)) + self.assertTrue(full_reconcile_lines.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + self.assertEqual(self.bill2.amount_residual, 50.0) + + def test_reconcile_partial_with_transfer_and_write_off_from_payable(self): + """ + Invoice 1 = 100, Invoice 2 = 50, Bill 1 = 100. + The difference is 50, with partial reconciliation, + 100 is transferred from payable to receivable + and 50 is written off with an expense account. + All documents should be fully reconciled. + """ + lines_to_reconcile = ( + self.invoice1.line_ids + self.invoice2.line_ids + self.bill1.line_ids + ).filtered( + lambda line: line.account_id.account_type + in ["asset_receivable", "liability_payable"] + ) + self.assertEqual(len(lines_to_reconcile), 3) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + wizard.allow_partial_reconcile = False + self.assertTrue(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertEqual(wizard.balance_difference, 50.0) + with self.assertRaisesRegex( + UserError, "The total of write-off lines must balance the difference" + ): + wizard._action_reconcile() + with Form(wizard) as wizard_form: + with wizard_form.write_off_line_ids.new() as line: + line.account_id = self.expense_account + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 7) # 3 original + 2 transfer + 2 write-off + new_move_lines = result_lines - lines_to_reconcile + self.assertEqual(len(new_move_lines), 4) + self.assertEqual(len(new_move_lines.move_id), 1) + # Check the transfer lines + transfer_origin = new_move_lines.filtered( + lambda line: "Transfer to" in line.name + ) + transfer_dest = new_move_lines.filtered( + lambda line: "Transfer from" in line.name + ) + self.assertEqual( + transfer_origin.account_id, self.partner.property_account_payable_id + ) + self.assertEqual(transfer_origin.debit, 100.0) + self.assertEqual( + transfer_dest.account_id, self.partner.property_account_receivable_id + ) + self.assertEqual(transfer_dest.credit, 100.0) + # Check the write-off lines + write_off_lines = new_move_lines - transfer_origin - transfer_dest + write_off_expense = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account + ) + write_off_receivable = write_off_lines.filtered( + lambda line: line.account_id == self.partner.property_account_receivable_id + ) + self.assertEqual(len(write_off_expense), 1) + self.assertEqual(write_off_expense.debit, 50.0) + self.assertEqual(len(write_off_receivable), 1) + self.assertEqual(write_off_receivable.credit, 50.0) + # Check the invoices and bill are fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + self.assertEqual(self.invoice2.amount_residual, 0.0) + self.assertEqual(self.bill1.amount_residual, 0.0) + + def test_reconcile_partial_with_transfer_and_write_off_from_receivable(self): + """ + Invoice 1 = 100, Bill 2 = 150. + The difference is -50, with partial reconciliation, + 100 is transferred from receivable to payable + and 50 is written off with an expense account. + All documents should be fully reconciled. + """ + lines_to_reconcile = (self.invoice1.line_ids + self.bill2.line_ids).filtered( + lambda line: line.account_id.account_type + in ["asset_receivable", "liability_payable"] + ) + self.assertEqual(len(lines_to_reconcile), 2) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + wizard.allow_partial_reconcile = False + self.assertTrue(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertEqual(wizard.balance_difference, -50.0) + with self.assertRaisesRegex( + UserError, "The total of write-off lines must balance the difference" + ): + wizard._action_reconcile() + with Form(wizard) as wizard_form: + with wizard_form.write_off_line_ids.new() as line: + line.account_id = self.expense_account + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 6) # 2 original + 2 transfer + 2 write-off + new_move_lines = result_lines - lines_to_reconcile + self.assertEqual(len(new_move_lines), 4) + self.assertEqual(len(new_move_lines.move_id), 1) + # Check the transfer lines + transfer_origin = new_move_lines.filtered( + lambda line: "Transfer to" in line.name + ) + transfer_dest = new_move_lines.filtered( + lambda line: "Transfer from" in line.name + ) + self.assertEqual( + transfer_origin.account_id, self.partner.property_account_receivable_id + ) + self.assertEqual(transfer_origin.credit, 100.0) + self.assertEqual( + transfer_dest.account_id, self.partner.property_account_payable_id + ) + self.assertEqual(transfer_dest.debit, 100.0) + # Check the write-off lines + write_off_lines = new_move_lines - transfer_origin - transfer_dest + write_off_expense = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account + ) + write_off_payable = write_off_lines.filtered( + lambda line: line.account_id == self.partner.property_account_payable_id + ) + self.assertEqual(len(write_off_expense), 1) + self.assertEqual(write_off_expense.credit, 50.0) + self.assertEqual(len(write_off_payable), 1) + self.assertEqual(write_off_payable.debit, 50.0) + # Check the invoices and bill are fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + self.assertEqual(self.bill2.amount_residual, 0.0) + + def test_reconcile_with_write_off_and_no_transfer(self): + """ + Invoice 1 = 100 + The difference is 100, with no transfer, + 100 is written off with an expense account. + The invoice1 should be fully reconciled. + """ + lines_to_reconcile = self.invoice1.line_ids.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + self.assertEqual(len(lines_to_reconcile), 1) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertFalse(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertFalse(wizard.display_allow_partial_reconcile) + self.assertFalse(wizard.allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 100.0) + self.assertEqual(wizard.write_off_amount, 0.0) + with self.assertRaisesRegex( + UserError, "The total of write-off lines must balance the difference" + ): + wizard._action_reconcile() + with Form(wizard) as wizard_form: + with wizard_form.write_off_line_ids.new() as line: + line.account_id = self.expense_account + line.credit = 100.0 + self.assertEqual(wizard.write_off_amount, -100.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 3) # 1 original + 2 write-off + # Check the write-off lines + write_off_lines = result_lines - lines_to_reconcile + write_off_expense = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account + ) + write_off_receivable = write_off_lines.filtered( + lambda line: line.account_id == self.partner.property_account_receivable_id + ) + self.assertEqual(len(write_off_expense), 1) + self.assertEqual(write_off_expense.debit, 100.0) + self.assertEqual(len(write_off_receivable), 1) + self.assertEqual(write_off_receivable.credit, 100.0) + # Check the invoice is fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + + def test_reconcile_with_write_off_two_accounts(self): + """ + Invoice 1 = 100 + The difference is 100, with no transfer, + 100 is written off with two expenses account. + The invoice1 should be fully reconciled. + """ + lines_to_reconcile = self.invoice1.line_ids.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + self.assertEqual(len(lines_to_reconcile), 1) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertFalse(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertFalse(wizard.display_allow_partial_reconcile) + self.assertFalse(wizard.allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 100.0) + self.assertEqual(wizard.write_off_amount, 0.0) + with self.assertRaisesRegex( + UserError, "The total of write-off lines must balance the difference" + ): + wizard._action_reconcile() + with Form(wizard) as wizard_form: + with wizard_form.write_off_line_ids.new() as line: + line.account_id = self.expense_account + line.credit = 60.0 + # The second line will be automatically created to balance the difference + with wizard_form.write_off_line_ids.new() as line: + line.account_id = self.expense_account2 + self.assertEqual(wizard.write_off_amount, -100.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 4) # 1 original + 3 write-off + # Check the write-off lines + write_off_lines = result_lines - lines_to_reconcile + write_off_expense1 = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account + ) + write_off_expense2 = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account2 + ) + write_off_receivable = write_off_lines.filtered( + lambda line: line.account_id == self.partner.property_account_receivable_id + ) + self.assertEqual(len(write_off_expense1), 1) + self.assertEqual(write_off_expense1.debit, 60.0) + self.assertEqual(len(write_off_expense2), 1) + self.assertEqual(write_off_expense2.debit, 40.0) + self.assertEqual(len(write_off_receivable), 1) + self.assertEqual(write_off_receivable.credit, 100.0) + # Check the invoice is fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) + + def test_reconcile_with_write_off_and_reconcile_model(self): + """ + Invoice 1 = 100 + The difference is 100, with no transfer, + 100 is written off using a reconcile model + with two lines of 40% and 60% on different expense accounts. + The invoice1 should be fully reconciled. + """ + lines_to_reconcile = self.invoice1.line_ids.filtered( + lambda line: line.account_id.account_type == "asset_receivable" + ) + self.assertEqual(len(lines_to_reconcile), 1) + wizard = self._create_reconcile_wizard(lines_to_reconcile) + self.assertFalse(wizard.need_transfer) + self.assertTrue(wizard.need_write_off) + self.assertFalse(wizard.display_allow_partial_reconcile) + self.assertFalse(wizard.allow_partial_reconcile) + self.assertEqual(wizard.balance_difference, 100.0) + self.assertEqual(wizard.write_off_amount, 0.0) + with Form(wizard) as wizard_form: + wizard_form.reconcile_model_id = self.reconcile_model_percentage + self.assertEqual(len(wizard.write_off_line_ids), 2) + self.assertEqual(wizard.write_off_amount, -100.0) + result_lines = wizard._action_reconcile() + self.assertEqual(len(result_lines), 4) # 1 original + 3 write-off + # Check the write-off lines + write_off_lines = result_lines - lines_to_reconcile + write_off_expense1 = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account + ) + write_off_expense2 = write_off_lines.filtered( + lambda line: line.account_id == self.expense_account2 + ) + write_off_receivable = write_off_lines.filtered( + lambda line: line.account_id == self.partner.property_account_receivable_id + ) + self.assertEqual(len(write_off_expense1), 1) + self.assertEqual(write_off_expense1.debit, 60.0) + self.assertEqual(len(write_off_expense2), 1) + self.assertEqual(write_off_expense2.debit, 40.0) + self.assertEqual(len(write_off_receivable), 1) + self.assertEqual(write_off_receivable.credit, 100.0) + # Check the invoice is fully reconciled + self.assertTrue(all(line.reconciled for line in lines_to_reconcile)) + self.assertTrue(lines_to_reconcile.full_reconcile_id) + self.assertEqual(self.invoice1.amount_residual, 0.0) diff --git a/account_reconcile_wizard/views/account_move_line.xml b/account_reconcile_wizard/views/account_move_line.xml new file mode 100644 index 0000000000..f46d01578c --- /dev/null +++ b/account_reconcile_wizard/views/account_move_line.xml @@ -0,0 +1,49 @@ + + + + account.move.line.reconcile.list + account.move.line + + 100 + + +
+
+
+
+
+ + Reconcile + account.move.line + list + [('display_type', 'not in', ('line_section', 'line_note')), ('account_id.reconcile', '=', True), ('parent_state', '=', 'posted'), ('full_reconcile_id', '=', False)] + {'journal_type': 'general', 'search_default_unreconciled': True, 'search_default_group_by_account': True, 'search_default_group_by_partner': True, 'expand': True} + + + + + + Reconcile + + + + + + + + +
diff --git a/account_reconcile_wizard/wizard/__init__.py b/account_reconcile_wizard/wizard/__init__.py new file mode 100644 index 0000000000..a0c81e6209 --- /dev/null +++ b/account_reconcile_wizard/wizard/__init__.py @@ -0,0 +1 @@ +from . import account_manual_reconcile_wizard diff --git a/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py b/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py new file mode 100644 index 0000000000..b203803e12 --- /dev/null +++ b/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.py @@ -0,0 +1,411 @@ +# Copyright 2026 Tecnativa - Carlos Lopez +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from collections import defaultdict + +from odoo import Command, api, fields, models +from odoo.exceptions import UserError +from odoo.tools.misc import format_amount + + +class AccountManualReconcileWizard(models.TransientModel): + _name = "account.manual.reconcile.wizard" + _description = "Manual Reconciliation Wizard" + _check_company_auto = True + + move_line_ids = fields.Many2many( + comodel_name="account.move.line", + string="Move Lines to Reconcile", + readonly=True, + ) + reconciliation_account_id = fields.Many2one( + "account.account", + compute="_compute_wizard_data", + store=True, + ) + company_id = fields.Many2one( + "res.company", + compute="_compute_wizard_data", + store=True, + ) + company_currency_id = fields.Many2one( + "res.currency", compute="_compute_wizard_data", store=True + ) + balance_difference = fields.Monetary( + compute="_compute_wizard_data", + currency_field="company_currency_id", + store=True, + ) + need_transfer = fields.Boolean( + compute="_compute_wizard_data", + store=True, + ) + need_write_off = fields.Boolean( + compute="_compute_wizard_data", + store=True, + ) + allow_partial_reconcile = fields.Boolean( + compute="_compute_allow_partial_reconcile", + store=True, + readonly=False, + help="Allow reconciliation even if balances do not match exactly", + ) + display_allow_partial_reconcile = fields.Boolean( + compute="_compute_wizard_data", + store=True, + ) + journal_id = fields.Many2one( + "account.journal", + check_company=True, + domain="[('type', '=', 'general')]", + compute="_compute_journal_id", + store=True, + readonly=False, + ) + date = fields.Date(default=fields.Date.context_today) + reference = fields.Char() + write_off_line_ids = fields.One2many( + "account.manual.reconcile.wizard.line", + "wizard_id", + help="Add lines for write-offs, adjustments, counterparts, etc.", + ) + write_off_amount = fields.Float(compute="_compute_write_off_amount") + + reconcile_model_id = fields.Many2one( + "account.reconcile.model", + domain=[ + ("rule_type", "=", "writeoff_button"), + ("counterpart_type", "=", "general"), + ], + help="Select a reconciliation model to auto-load lines", + ) + + @api.depends("move_line_ids") + def _compute_allow_partial_reconcile(self): + for wizard in self: + wizard.allow_partial_reconcile = len(wizard.move_line_ids) > 1 + + @api.depends("move_line_ids", "allow_partial_reconcile") + def _compute_wizard_data(self): + for wizard in self: + lines = wizard.move_line_ids + company = lines.company_id + currency = company.currency_id + wizard.company_id = company + wizard.company_currency_id = currency + total_debit = total_credit = 0.0 + amounts_by_account = defaultdict(float) + accounts = lines.account_id + for line in lines: + total_debit += line.amount_residual if line.debit > 0 else 0.0 + total_credit += line.amount_residual if line.credit > 0 else 0.0 + amounts_by_account[line.account_id] += line.amount_residual + reconciliation_account_id = accounts[0] + need_transfer = False + if len(accounts) == 2: + need_transfer = True + if abs(amounts_by_account[accounts[1]]) > abs( + amounts_by_account[accounts[0]] + ): + reconciliation_account_id = accounts[1] + wizard.reconciliation_account_id = reconciliation_account_id + wizard.balance_difference = total_debit + total_credit + wizard.need_transfer = need_transfer + wizard.need_write_off = not currency.is_zero(wizard.balance_difference) + wizard.display_allow_partial_reconcile = total_debit and total_credit + + @api.depends("company_id") + def _compute_journal_id(self): + for wizard in self: + wizard.journal_id = self.env["account.journal"].search( + [ + *self.env["account.journal"]._check_company_domain( + wizard.company_id + ), + ("type", "=", "general"), + ], + limit=1, + ) + + @api.depends( + "write_off_line_ids", "write_off_line_ids.debit", "write_off_line_ids.credit" + ) + def _compute_write_off_amount(self): + for wizard in self: + wizard.write_off_amount = sum( + line.debit - line.credit for line in wizard.write_off_line_ids + ) + + @api.onchange("reconcile_model_id") + def _onchange_reconcile_model_id(self): + if self.reconcile_model_id: + self.write_off_line_ids = [Command.clear()] + line_vals = [] + balance_amount = self.balance_difference + for model_line in self.reconcile_model_id.line_ids: + if model_line.amount_type == "fixed": + amount = model_line.amount + elif model_line.amount_type in ["percentage", "percentage_st_line"]: + amount = balance_amount * model_line.amount * 0.01 + if self.company_currency_id.is_zero(amount): + continue + line_vals.append( + Command.create( + { + "name": model_line.label or self.env._("Write-Off"), + "account_id": model_line.account_id.id, + "credit": amount if amount > 0 else 0.0, + "debit": -amount if amount < 0 else 0.0, + "analytic_distribution": model_line.analytic_distribution, + }, + ) + ) + self.write_off_line_ids = line_vals + + @api.model + def _check_move_lines(self, move_lines): + companies = move_lines.company_id + if len(companies) > 1: + raise UserError( + self.env._("All selected lines must be from the same company.") + ) + reconciled_lines = move_lines.filtered("reconciled") + if reconciled_lines: + raise UserError(self.env._("Cannot reconcile already reconciled lines.")) + if len(move_lines.account_id) > 2: + raise UserError( + self.env._( + "You can only reconcile entries from up to 2 different accounts." + ) + ) + if len(move_lines.partner_id) > 1: + raise UserError( + self.env._("You can only reconcile entries from the same partner.") + ) + + @api.model + def default_get(self, fields_list): + res = super().default_get(fields_list) + # Get selected move lines from context + active_ids = self.env.context.get("active_ids", []) + active_model = self.env.context.get("active_model") + if ( + "move_line_ids" in fields_list + and active_model == "account.move.line" + and active_ids + ): + move_lines = self.env["account.move.line"].browse(active_ids) + self._check_move_lines(move_lines) + res["move_line_ids"] = [Command.set(move_lines.ids)] + return res + + def _prepare_account_move_vals(self): + return { + "journal_id": self.journal_id.id, + "date": self.date, + "ref": self.reference, + "company_id": self.company_id.id, + "move_type": "entry", + } + + def _prepare_transfer_lines(self): + lines_to_transfer = self.move_line_ids.filtered( + lambda line: line.account_id != self.reconciliation_account_id + ) + from_account = self.move_line_ids.account_id - self.reconciliation_account_id + amount = sum(line.amount_residual for line in lines_to_transfer) + partner = self.move_line_ids.partner_id + line_vals = [ + Command.create( + { + "name": self.env._( + "Transfer to %s", + self.reconciliation_account_id.display_name, + ), + "account_id": from_account.id, + "partner_id": partner.id, + "balance": -amount, + } + ), + Command.create( + { + "name": self.env._("Transfer from %s", from_account.display_name), + "account_id": self.reconciliation_account_id.id, + "partner_id": partner.id, + "balance": amount, + } + ), + ] + return line_vals + + def _prepare_write_off_lines(self): + partner = self.move_line_ids.partner_id + line_values = [ + Command.create( + { + "name": self.env._("Write-Off"), + "account_id": self.reconciliation_account_id.id, + "partner_id": partner.id, + "balance": -self.balance_difference, + } + ) + ] + for line in self.write_off_line_ids: + balance = line.debit - line.credit + line_values.append( + Command.create( + { + "name": line.name or self.env._("Write-Off"), + "account_id": line.account_id.id, + "partner_id": partner.id, + "analytic_distribution": line.analytic_distribution, + "balance": -balance, + } + ) + ) + return line_values + + def create_account_move(self, line_values): + self.ensure_one() + move_vals = self._prepare_account_move_vals() + move_vals.update({"line_ids": line_values}) + account_move = ( + self.env["account.move"] + .with_context( + skip_invoice_sync=True, + skip_invoice_line_sync=True, + ) + .create(move_vals) + ) + account_move.action_post() + return account_move + + def _validate_reconciliation(self): + total_write_off = sum( + line.debit - line.credit for line in self.write_off_line_ids + ) + if not self.company_currency_id.is_zero( + total_write_off + self.balance_difference + ): + amount_str = format_amount( + self.env, self.balance_difference, self.company_currency_id + ) + raise UserError( + self.env._( + "The total of write-off lines must balance the difference of %s.", + amount_str, + ) + ) + + def _action_reconcile(self): + if self.need_write_off and not self.allow_partial_reconcile: + self._validate_reconciliation() + lines_to_reconcile = self.move_line_ids + new_move_lines = [] + if self.need_transfer: + new_move_lines.extend(self._prepare_transfer_lines()) + if self.need_write_off and not self.allow_partial_reconcile: + new_move_lines.extend(self._prepare_write_off_lines()) + if new_move_lines: + account_move = self.create_account_move(new_move_lines) + lines_to_reconcile += account_move.line_ids + lines_by_account = lines_to_reconcile.grouped("account_id") + for account, lines in lines_by_account.items(): + if account.reconcile: + self.env["account.move.line"]._reconcile_plan([lines]) + return lines_to_reconcile + + def _get_action(self): + return { + "type": "ir.actions.client", + "tag": "display_notification", + "params": { + "title": self.env._("Success"), + "message": self.env._( + "The selected lines have been successfully reconciled." + ), + "type": "success", + "next": {"type": "ir.actions.act_window_close"}, + }, + } + + def action_reconcile(self): + self._action_reconcile() + return self._get_action() + + def action_reconcile_and_open(self): + action = self._get_action() + move_lines_reconciled = self._action_reconcile() + if move_lines_reconciled: + action["params"]["next"] = move_lines_reconciled.open_reconcile_view() + return action + + +class AccountManualReconcileWizardLine(models.TransientModel): + _inherit = "analytic.mixin" + _name = "account.manual.reconcile.wizard.line" + _description = "Account Manual Reconcile Line" + _check_company_auto = True + + wizard_id = fields.Many2one("account.manual.reconcile.wizard", ondelete="cascade") + company_id = fields.Many2one(related="wizard_id.company_id") + company_currency_id = fields.Many2one( + related="company_id.currency_id", string="Currency" + ) + name = fields.Char( + string="Description", default=lambda self: self.env._("Write-Off") + ) + account_id = fields.Many2one( + "account.account", + required=True, + check_company=True, + domain="[('deprecated', '=', False), ('account_type', '!=', 'off_balance')]", + ) + debit = fields.Monetary( + compute="_compute_debit", + currency_field="company_currency_id", + store=True, + readonly=False, + ) + credit = fields.Monetary( + compute="_compute_credit", + currency_field="company_currency_id", + store=True, + readonly=False, + ) + + @api.depends("wizard_id") + def _compute_debit(self): + for line in self: + if line.wizard_id.balance_difference < 0 and not line.debit: + line.debit = ( + -line.wizard_id.balance_difference - line.wizard_id.write_off_amount + ) + + @api.depends("wizard_id") + def _compute_credit(self): + for line in self: + if line.wizard_id.balance_difference > 0 and not line.credit: + line.credit = ( + line.wizard_id.balance_difference + line.wizard_id.write_off_amount + ) + + @api.onchange("debit") + def _onchange_debit(self): + for line in self: + if line.debit: + line.credit = 0 + + @api.onchange("credit") + def _onchange_credit(self): + for line in self: + if line.credit: + line.debit = 0 + + @api.constrains("debit", "credit") + def _check_debit_credit(self): + for line in self: + if line.debit < 0 or line.credit < 0: + raise UserError( + self.env._("Debit and credit amounts must be positive.") + ) diff --git a/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.xml b/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.xml new file mode 100644 index 0000000000..149d85b2e2 --- /dev/null +++ b/account_reconcile_wizard/wizard/account_manual_reconcile_wizard.xml @@ -0,0 +1,109 @@ + + + + account.manual.reconcile.wizard.form + account.manual.reconcile.wizard + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+