oleksandrpaziuk
7 years ago
committed by
mpanarin
6 changed files with 215 additions and 0 deletions
-
95account_bank_statement_line_reconciliation/README.rst
-
5account_bank_statement_line_reconciliation/__init__.py
-
21account_bank_statement_line_reconciliation/__manifest__.py
-
5account_bank_statement_line_reconciliation/wizard/__init__.py
-
53account_bank_statement_line_reconciliation/wizard/account_bank_statement_line_reconciliation_wizard.py
-
36account_bank_statement_line_reconciliation/wizard/account_bank_statement_line_reconciliation_wizard.xml
@ -0,0 +1,95 @@ |
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
========================================== |
|||
Account Bank Statement Line Reconciliation |
|||
========================================== |
|||
|
|||
The wizard provides the ability to specify bank statement line when it needed. |
|||
The only users from security group "Settings" can use it. |
|||
|
|||
Usage |
|||
===== |
|||
|
|||
This module is for you if you work with Odoo enterprise and you messed up the bank reconcile report. |
|||
|
|||
The bank reconciliation report is accessible from the hyperlink 'Difference' which appears on bank journals cards when the GL balance differs from the bank statement balance. |
|||
|
|||
There are only 2 situation handled from field filter (from bank reconcile view) but there are more in real life: |
|||
|
|||
1 - Blue lines appear if account_move_lines have these values: |
|||
|
|||
.. code-block:: python |
|||
|
|||
statement_id = false |
|||
AND payment_id = true |
|||
AND account_id = current bank |
|||
|
|||
-> This means that if you post a payment journal entry manually (meaning that you do not use the register payment button) the payment_id will not be populated then the payment_id will not be populated. When this happens, your entry won't match: you are stuck and you need this module to prevent this situation. |
|||
|
|||
Same issue in case of migration of payment entries with no payment_id |
|||
|
|||
|
|||
2 - If 1st request is not applicable then Odoo will look up for account_move_lines with: |
|||
|
|||
.. code-block:: python |
|||
|
|||
reconcile_id = false |
|||
account_id = flagged as 'Allow reconciliation" = true |
|||
excluding the line in the move with the bank account. |
|||
|
|||
-> This means that if you have created entries on a reconciliable account but you never reconcile it (ie: a cut-off entry or a correction) this line will appear forever in the list of possible matches -> so you may need this module to clean it up. |
|||
|
|||
|
|||
To use this module, you need to: |
|||
|
|||
#. Go to Accounting > Adviser > Journal Entries |
|||
#. Select one or more Journal Entry items |
|||
#. Press 'Action > Bank reconcile report change' |
|||
#. Select required value in 'New value' field. Leave empty if you want to set empty value. |
|||
#. Press 'Set value' |
|||
|
|||
By doing this, you will create/delete the link between Journal entry and bank statement lines hence you will make corrections on the bank reconcile report which would be impossible to do through the Odoo interface. |
|||
|
|||
|
|||
|
|||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas |
|||
:alt: Try me on Runbot |
|||
:target: https://runbot.odoo-community.org/runbot/91/10.0 |
|||
|
|||
Bug Tracker |
|||
=========== |
|||
|
|||
Bugs are tracked on `GitHub Issues |
|||
<https://github.com/OCA/account-financial-reporting/issues>`_. In case of trouble, |
|||
please check there if your issue has already been reported. If you spotted it |
|||
first, help us smash it by providing detailed and welcomed feedback. |
|||
|
|||
Credits |
|||
======= |
|||
|
|||
Images |
|||
------ |
|||
|
|||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. |
|||
|
|||
Contributors |
|||
------------ |
|||
|
|||
* Camptocamp SA |
|||
|
|||
Maintainer |
|||
---------- |
|||
|
|||
.. image:: https://odoo-community.org/logo.png |
|||
:alt: Odoo Community Association |
|||
:target: https://odoo-community.org |
|||
|
|||
This module is maintained by the OCA. |
|||
|
|||
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. |
|||
|
|||
To contribute to this module, please visit https://odoo-community.org. |
@ -0,0 +1,5 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2018 Camptocamp SA |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import wizard |
@ -0,0 +1,21 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2018 Camptocamp SA |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
{ |
|||
'name': 'Account Bank Statement Line Reconciliation', |
|||
'version': '10.0.1.0.0', |
|||
'category': 'Accounting & Finance', |
|||
'summary': 'OCA Financial Reports', |
|||
'author': "Camptocamp, Odoo Community Association (OCA)", |
|||
'website': 'https://github.com/OCA/account-financial-reporting', |
|||
'license': 'AGPL-3', |
|||
'depends': [ |
|||
'account_accountant', |
|||
], |
|||
'data': [ |
|||
'wizard/account_bank_statement_line_reconciliation_wizard.xml', |
|||
], |
|||
'installable': True, |
|||
'application': False, |
|||
} |
@ -0,0 +1,5 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2018 Camptocamp SA |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from . import account_bank_statement_line_reconciliation_wizard |
@ -0,0 +1,53 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2018 Camptocamp SA |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
|
|||
from odoo import models, fields, api, _ |
|||
from odoo.exceptions import ValidationError |
|||
|
|||
|
|||
class AccountBankStatementLineReconciliationWizard(models.TransientModel): |
|||
_name = "account.bank.statement.line.reconciliation.wizard" |
|||
|
|||
statement_line_ids = fields.Many2many( |
|||
string='Current values', |
|||
comodel_name='account.bank.statement.line', |
|||
compute='_compute_statement_line_ids', |
|||
) |
|||
new_statement_line_id = fields.Many2one( |
|||
string='New value', |
|||
comodel_name='account.bank.statement.line', |
|||
) |
|||
|
|||
def _account_move_ids(self): |
|||
ids = self._context.get('active_ids') |
|||
account_move_ids = self.env['account.move'] |
|||
if ids: |
|||
account_move_ids = account_move_ids.browse(ids) |
|||
|
|||
journal_ids = account_move_ids.mapped('journal_id') |
|||
|
|||
if len(account_move_ids) > 1 and len(journal_ids) > 1: |
|||
msg = _("Please only select Journal entries " |
|||
"that belongs to the same bank journal") |
|||
raise ValidationError(msg) |
|||
|
|||
return account_move_ids |
|||
|
|||
def _compute_statement_line_ids(self): |
|||
for record in self: |
|||
account_move_ids = record._account_move_ids() |
|||
record.statement_line_ids = [ |
|||
(6, 0, account_move_ids.mapped('statement_line_id').ids), |
|||
] |
|||
|
|||
@api.multi |
|||
def set_new_statement_line_value(self): |
|||
account_move_ids = self._account_move_ids() |
|||
account_move_ids.write({ |
|||
'statement_line_id': self.new_statement_line_id.id, |
|||
}) |
|||
account_move_ids.mapped("line_ids").write({ |
|||
'statement_id': self.new_statement_line_id.statement_id.id, |
|||
}) |
|||
return {} |
@ -0,0 +1,36 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
|
|||
<act_window id="action_account_bank_statement_line_reconciliation_wizard" |
|||
name="Bank reconcile report change" |
|||
src_model="account.move" |
|||
res_model="account.bank.statement.line.reconciliation.wizard" |
|||
view_mode="form" |
|||
target="new" |
|||
key2="client_action_multi" |
|||
groups="base.group_system"/> |
|||
|
|||
<record id="account_bank_statement_line_reconciliation_wizard" model="ir.ui.view"> |
|||
<field name="name">Bank reconcile report change</field> |
|||
<field name="model">account.bank.statement.line.reconciliation.wizard</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Bank reconcile report change"> |
|||
<sheet> |
|||
<group> |
|||
<field name="statement_line_ids"> |
|||
<tree> |
|||
<field name="name" string="Entry"/> |
|||
</tree> |
|||
</field> |
|||
<field name="new_statement_line_id" options="{'no_create': True, 'no_create_edit': True}"/> |
|||
</group> |
|||
</sheet> |
|||
<footer> |
|||
<button string="Set value" name="set_new_statement_line_value" type="object" class="btn-primary"/> |
|||
<button string="Cancel" class="btn-default" special="cancel" /> |
|||
</footer> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue