Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] account_move_reconcile_helper #588

Open
wants to merge 18 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions account_move_reconcile_helper/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
=============================
Account Move Reconcile Helper
=============================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/14.0/account_move_reconcile_helper
: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-14-0/account-reconcile-14-0-account_move_reconcile_helper
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/98/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|


Provides tools to facilitate reconciliation.

* Display a button on Journal Items to show reconciled lines.
* Added Balance field in Journal Items (this feature
is provided by account_balance_line).

.. image:: https://raw.githubusercontent.com/OCA/account-reconcile/14.0/account_move_reconcile_helper/static/docs/journal_items.png
:alt: Journal items
:scale: 50 %

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-reconcile/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_move_reconcile_helper%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
~~~~~~~

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Benjamin Willig <benjamin.willig@acsone.eu>
* Kitti U. <kittiu@ecosoft.co.th>

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.

This module is part of the `OCA/account-reconcile <https://github.com/OCA/account-reconcile/tree/14.0/account_move_reconcile_helper>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_move_reconcile_helper/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions account_move_reconcile_helper/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Move Reconcile Helper",
"summary": "Provides tools to facilitate reconciliation",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-reconcile",
"depends": ["account"],
"data": ["views/account_move_line.xml"],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_reconcile_helper
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \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_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__display_name
msgid "Display Name"
msgstr ""

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__id
msgid "ID"
msgstr ""

#. module: account_move_reconcile_helper
#: model:ir.model,name:account_move_reconcile_helper.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line____last_update
msgid "Last Modified on"
msgstr ""

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__reconcile_line_ids
#: model_terms:ir.ui.view,arch_db:account_move_reconcile_helper.account_move_line_tree_view
msgid "Reconciled lines"
msgstr ""
36 changes: 36 additions & 0 deletions account_move_reconcile_helper/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_reconcile_helper
#
# Translators:
# enjolras <yo@miguelrevilla.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-09 01:44+0000\n"
"PO-Revision-Date: 2022-04-11 19:05+0000\n"
"Last-Translator: Dept. Técnico <tecnico@extrememicro.es>\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: account_move_reconcile_helper
#: model:ir.model,name:account_move_reconcile_helper.model_account_move_line
msgid "Journal Item"
msgstr "Apunte contable"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__partial_reconciliation_in_progress
msgid "Partial Reconciliation In Progress"
msgstr "Reconciliación parcial en progreso"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__reconcile_line_ids
#: model_terms:ir.ui.view,arch_db:account_move_reconcile_helper.account_move_line_tree_view
msgid "Reconciled lines"
msgstr "Líneas reconciliadas"
37 changes: 37 additions & 0 deletions account_move_reconcile_helper/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_reconcile_helper
#
# Translators:
# Quentin THEURET <odoo@kerpeo.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-20 20:58+0000\n"
"PO-Revision-Date: 2018-03-20 20:58+0000\n"
"Last-Translator: Quentin THEURET <odoo@kerpeo.com>, 2018\n"
"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"

#. module: account_move_reconcile_helper
#: model:ir.model,name:account_move_reconcile_helper.model_account_move_line
msgid "Journal Item"
msgstr "Écriture comptable"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__partial_reconciliation_in_progress
#, fuzzy
#| msgid "Partial reconciliation in progress"
msgid "Partial Reconciliation In Progress"
msgstr "Lettrage partiel en cours"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__reconcile_line_ids
#: model_terms:ir.ui.view,arch_db:account_move_reconcile_helper.account_move_line_tree_view
msgid "Reconciled lines"
msgstr "Lignes lettrées"
37 changes: 37 additions & 0 deletions account_move_reconcile_helper/i18n/hr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_move_reconcile_helper
#
# Translators:
# Bole <bole@dajmi5.com>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-09 01:44+0000\n"
"PO-Revision-Date: 2019-11-13 14:34+0000\n"
"Last-Translator: Bole <bole@dajmi5.com>\n"
"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n"
"Language: hr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<="
"4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 3.8\n"

#. module: account_move_reconcile_helper
#: model:ir.model,name:account_move_reconcile_helper.model_account_move_line
msgid "Journal Item"
msgstr "Stavka dnevnika"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__partial_reconciliation_in_progress
msgid "Partial Reconciliation In Progress"
msgstr "Djelomično zatvaranju u postupku"

#. module: account_move_reconcile_helper
#: model:ir.model.fields,field_description:account_move_reconcile_helper.field_account_move_line__reconcile_line_ids
#: model_terms:ir.ui.view,arch_db:account_move_reconcile_helper.account_move_line_tree_view
msgid "Reconciled lines"
msgstr "Zatvorene stavke"
1 change: 1 addition & 0 deletions account_move_reconcile_helper/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move_line
58 changes: 58 additions & 0 deletions account_move_reconcile_helper/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class AccountMoveLine(models.Model):

_inherit = "account.move.line"

reconcile_line_ids = fields.One2many(
compute="_compute_reconciled_lines",
comodel_name="account.move.line",
string="Reconciled lines",
)

def _compute_reconciled_lines(self):
for rec in self:
rec.reconcile_line_ids = rec._get_reconciled_lines()

def _get_reconciled_lines(self, move_lines=None):
"""
Returns lines which were reconciled directly or indirectly with
current lines given in self.

If A has been reconciled (or partially) with B, and B with C. This
method will returns A, B, and C.

:param move_lines: found moves lines to avoid recursivity
:return: recordset('account.move.line')
"""
move_lines = move_lines or self.env[self._name]

for line in self:
if line.full_reconcile_id:
matched_lines = line.full_reconcile_id.reconciled_line_ids
elif line.credit > 0:
matched_lines = line.matched_debit_ids.mapped("debit_move_id")
else:
matched_lines = line.matched_credit_ids.mapped("credit_move_id")

if not matched_lines:
continue

move_lines |= line

for matched_line in matched_lines:
if matched_line not in move_lines:
move_lines |= matched_line
move_lines |= matched_line._get_reconciled_lines(move_lines)

return move_lines

def open_full_reconcile_view(self):
view = "account.action_account_moves_all_a"
action = self.env["ir.actions.act_window"]._for_xml_id(view)
action["domain"] = [("id", "in", self.mapped("reconcile_line_ids").ids)]
return action
2 changes: 2 additions & 0 deletions account_move_reconcile_helper/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Benjamin Willig <benjamin.willig@acsone.eu>
* Kitti U. <kittiu@ecosoft.co.th>
10 changes: 10 additions & 0 deletions account_move_reconcile_helper/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

Provides tools to facilitate reconciliation.

* Display a button on Journal Items to show reconciled lines.
* Added Balance field in Journal Items (this feature
is provided by account_balance_line).

.. image:: ./static/docs/journal_items.png
:alt: Journal items
:scale: 50 %
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading