[12.0][IMP] account_skip_bank_reconciliation: allow to specify accounts to be proposed on reconciliation inside bank journal

This commit is contained in:
Adrià Gil Sorribes
2020-05-18 16:19:03 +02:00
committed by Lois Rilo
parent 1c0564baeb
commit 8ab3e8290f
7 changed files with 57 additions and 15 deletions

View File

@@ -12,6 +12,7 @@
"category": "Finance",
"data": [
"views/account_view.xml",
"views/account_journal_view.xml",
],
'license': 'AGPL-3',
'installable': True,

View File

@@ -1,5 +1,6 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import account_account
from . import account_journal
from . import reconciliation_widget
from . import account_reconcile_model

View File

@@ -0,0 +1,17 @@
# Copyright 2020 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class AccountJournal(models.Model):
_inherit = "account.journal"
account_reconciliation_ids = fields.Many2many(
relation="account_reconcile_account_journal_rel",
comodel_name="account.account",
string="Accounts to consider in reconciliation",
domain=[("reconcile", "=", True)],
help="If you enter accounts here they will be the only ones"
"to be considered during the reconciliation"
)

View File

@@ -17,15 +17,10 @@ class AccountReconciliation(models.AbstractModel):
excluded_ids=excluded_ids, search_str=search_str)
domain = expression.AND([domain, [
("account_id.exclude_bank_reconcile", "!=", True)]])
return domain
@api.model
def _domain_move_lines_for_manual_reconciliation(
self, account_id, partner_id=False,
excluded_ids=None, search_str=False):
domain = super()._domain_move_lines_for_manual_reconciliation(
account_id, partner_id=partner_id,
excluded_ids=excluded_ids, search_str=search_str)
domain = expression.AND([domain, [
("account_id.exclude_bank_reconcile", "!=", True)]])
# Extract from context allowed accounts defined in Journal, if any
journal_id = st_line.journal_id
account_reconciliation_ids = journal_id.account_reconciliation_ids
if account_reconciliation_ids:
domain = expression.AND([domain, [
("account_id", "in", account_reconciliation_ids.ids)]])
return domain

View File

@@ -1,5 +1,7 @@
This module allows to exclude from bank statement reconciliation
all journal items of a specific reconcilable account.
all journal items of a specific reconcilable account. It also allows
to specify in the Bank Journal which accounts should be taken into account
for reconciliation.
Usually, you would want to that in accounts like the
`Goods Received Not Invoiced`, which are required to be reconcilable

View File

@@ -1,5 +1,15 @@
To use this module, you need to:
To use this module, you can choose one of the following approaches:
#. Go to `Invoicing / Configuration / Accounting / Charts of Accounts`
1. Go to `Invoicing / Configuration / Accounting / Charts of Accounts`
and open a reconcilable account.
#. In that account, select or not the `Exclude from Bank Reconciliation` option.
2. In that account, select or not the `Exclude from Bank Reconciliation` option.
or
1. Go to `Invoicing / Configuration / Accounting / Journals` and open any
bank Journal
2. In the Journal select the accounts that you would like to be proposed in
reconciliations.
Be careful, if an account is set to be excluded it will be excluded even if it
appears in the Bank Journal to be considered for reconciliation.

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_account_journal_form" model="ir.ui.view">
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="arch" type="xml">
<group name="group_alias" position="after">
<group name="group_alias" string="Reconciliation Accounts" attrs="{'invisible': [('type', '!=', 'bank')]}">
<field name="account_reconciliation_ids" widget="many2many_tags"/>
</group>
</group>
</field>
</record>
</odoo>