mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_skip_bank_reconciliation: black, isort, prettier
This commit is contained in:
@@ -4,16 +4,13 @@
|
||||
{
|
||||
"name": "Account Skip Bank Reconciliation",
|
||||
"summary": "Allows to exclude from bank statement reconciliation "
|
||||
"all journal items of a reconcilable account",
|
||||
"all journal items of a reconcilable account",
|
||||
"version": "12.0.1.1.0",
|
||||
"depends": ["account"],
|
||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||
"website": "http://www.github.com/OCA/account-reconcile",
|
||||
"category": "Finance",
|
||||
"data": [
|
||||
"views/account_view.xml",
|
||||
"views/account_journal_view.xml",
|
||||
],
|
||||
'license': 'AGPL-3',
|
||||
'installable': True,
|
||||
"data": ["views/account_view.xml", "views/account_journal_view.xml",],
|
||||
"license": "AGPL-3",
|
||||
"installable": True,
|
||||
}
|
||||
|
||||
@@ -8,8 +8,9 @@ class AccountAccount(models.Model):
|
||||
_inherit = "account.account"
|
||||
|
||||
exclude_bank_reconcile = fields.Boolean(
|
||||
string='Exclude from Bank Reconciliation',
|
||||
string="Exclude from Bank Reconciliation",
|
||||
default=False,
|
||||
help="Check this box if the journal items of this account "
|
||||
"should not appear in the list of journal items to match "
|
||||
"a statement line.")
|
||||
"should not appear in the list of journal items to match "
|
||||
"a statement line.",
|
||||
)
|
||||
|
||||
@@ -13,5 +13,5 @@ class AccountJournal(models.Model):
|
||||
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"
|
||||
"to be considered during the reconciliation",
|
||||
)
|
||||
|
||||
@@ -9,7 +9,8 @@ class AccountReconcileModel(models.Model):
|
||||
|
||||
@api.multi
|
||||
def _apply_conditions(self, query, params):
|
||||
query, params = super(
|
||||
AccountReconcileModel, self)._apply_conditions(query, params)
|
||||
query += ' AND account.exclude_bank_reconcile IS NOT TRUE'
|
||||
query, params = super(AccountReconcileModel, self)._apply_conditions(
|
||||
query, params
|
||||
)
|
||||
query += " AND account.exclude_bank_reconcile IS NOT TRUE"
|
||||
return query, params
|
||||
|
||||
@@ -10,17 +10,23 @@ class AccountReconciliation(models.AbstractModel):
|
||||
|
||||
@api.model
|
||||
def _domain_move_lines_for_reconciliation(
|
||||
self, st_line, aml_accounts, partner_id,
|
||||
excluded_ids=None, search_str=False):
|
||||
self, st_line, aml_accounts, partner_id, excluded_ids=None, search_str=False
|
||||
):
|
||||
domain = super()._domain_move_lines_for_reconciliation(
|
||||
st_line, aml_accounts, partner_id,
|
||||
excluded_ids=excluded_ids, search_str=search_str)
|
||||
domain = expression.AND([domain, [
|
||||
("account_id.exclude_bank_reconcile", "!=", True)]])
|
||||
st_line,
|
||||
aml_accounts,
|
||||
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)]])
|
||||
domain = expression.AND(
|
||||
[domain, [("account_id", "in", account_reconciliation_ids.ids)]]
|
||||
)
|
||||
return domain
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?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="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
|
||||
name="group_alias"
|
||||
string="Reconciliation Accounts"
|
||||
attrs="{'invisible': [('type', '!=', 'bank')]}"
|
||||
>
|
||||
<field name="account_reconciliation_ids" widget="many2many_tags" />
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_account_form" model="ir.ui.view">
|
||||
<field name="name">account.account.form</field>
|
||||
<field name="model">account.account</field>
|
||||
<field name="inherit_id" ref="account.view_account_form"/>
|
||||
<field name="inherit_id" ref="account.view_account_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div/field[@name='reconcile']/.." position="after">
|
||||
<field name="exclude_bank_reconcile" attrs="{'invisible': [('reconcile', '=', False)]}" domain="[('reconcile', '=', True)]"/>
|
||||
<field
|
||||
name="exclude_bank_reconcile"
|
||||
attrs="{'invisible': [('reconcile', '=', False)]}"
|
||||
domain="[('reconcile', '=', True)]"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../../../../account_skip_bank_reconciliation
|
||||
6
setup/account_skip_bank_reconciliation/setup.py
Normal file
6
setup/account_skip_bank_reconciliation/setup.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['setuptools-odoo'],
|
||||
odoo_addon=True,
|
||||
)
|
||||
Reference in New Issue
Block a user