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:
@@ -10,10 +10,7 @@
|
|||||||
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
"author": "ForgeFlow, Odoo Community Association (OCA)",
|
||||||
"website": "http://www.github.com/OCA/account-reconcile",
|
"website": "http://www.github.com/OCA/account-reconcile",
|
||||||
"category": "Finance",
|
"category": "Finance",
|
||||||
"data": [
|
"data": ["views/account_view.xml", "views/account_journal_view.xml",],
|
||||||
"views/account_view.xml",
|
"license": "AGPL-3",
|
||||||
"views/account_journal_view.xml",
|
"installable": True,
|
||||||
],
|
|
||||||
'license': 'AGPL-3',
|
|
||||||
'installable': True,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ class AccountAccount(models.Model):
|
|||||||
_inherit = "account.account"
|
_inherit = "account.account"
|
||||||
|
|
||||||
exclude_bank_reconcile = fields.Boolean(
|
exclude_bank_reconcile = fields.Boolean(
|
||||||
string='Exclude from Bank Reconciliation',
|
string="Exclude from Bank Reconciliation",
|
||||||
default=False,
|
default=False,
|
||||||
help="Check this box if the journal items of this account "
|
help="Check this box if the journal items of this account "
|
||||||
"should not appear in the list of journal items to match "
|
"should not appear in the list of journal items to match "
|
||||||
"a statement line.")
|
"a statement line.",
|
||||||
|
)
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ class AccountJournal(models.Model):
|
|||||||
string="Accounts to consider in reconciliation",
|
string="Accounts to consider in reconciliation",
|
||||||
domain=[("reconcile", "=", True)],
|
domain=[("reconcile", "=", True)],
|
||||||
help="If you enter accounts here they will be the only ones"
|
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
|
@api.multi
|
||||||
def _apply_conditions(self, query, params):
|
def _apply_conditions(self, query, params):
|
||||||
query, params = super(
|
query, params = super(AccountReconcileModel, self)._apply_conditions(
|
||||||
AccountReconcileModel, self)._apply_conditions(query, params)
|
query, params
|
||||||
query += ' AND account.exclude_bank_reconcile IS NOT TRUE'
|
)
|
||||||
|
query += " AND account.exclude_bank_reconcile IS NOT TRUE"
|
||||||
return query, params
|
return query, params
|
||||||
|
|||||||
@@ -10,17 +10,23 @@ class AccountReconciliation(models.AbstractModel):
|
|||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _domain_move_lines_for_reconciliation(
|
def _domain_move_lines_for_reconciliation(
|
||||||
self, st_line, aml_accounts, partner_id,
|
self, st_line, aml_accounts, partner_id, excluded_ids=None, search_str=False
|
||||||
excluded_ids=None, search_str=False):
|
):
|
||||||
domain = super()._domain_move_lines_for_reconciliation(
|
domain = super()._domain_move_lines_for_reconciliation(
|
||||||
st_line, aml_accounts, partner_id,
|
st_line,
|
||||||
excluded_ids=excluded_ids, search_str=search_str)
|
aml_accounts,
|
||||||
domain = expression.AND([domain, [
|
partner_id,
|
||||||
("account_id.exclude_bank_reconcile", "!=", True)]])
|
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
|
# Extract from context allowed accounts defined in Journal, if any
|
||||||
journal_id = st_line.journal_id
|
journal_id = st_line.journal_id
|
||||||
account_reconciliation_ids = journal_id.account_reconciliation_ids
|
account_reconciliation_ids = journal_id.account_reconciliation_ids
|
||||||
if account_reconciliation_ids:
|
if account_reconciliation_ids:
|
||||||
domain = expression.AND([domain, [
|
domain = expression.AND(
|
||||||
("account_id", "in", account_reconciliation_ids.ids)]])
|
[domain, [("account_id", "in", account_reconciliation_ids.ids)]]
|
||||||
|
)
|
||||||
return domain
|
return domain
|
||||||
|
|||||||
@@ -1,16 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="view_account_journal_form" model="ir.ui.view">
|
<record id="view_account_journal_form" model="ir.ui.view">
|
||||||
<field name="model">account.journal</field>
|
<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">
|
<field name="arch" type="xml">
|
||||||
<group name="group_alias" position="after">
|
<group name="group_alias" position="after">
|
||||||
<group name="group_alias" string="Reconciliation Accounts" attrs="{'invisible': [('type', '!=', 'bank')]}">
|
<group
|
||||||
|
name="group_alias"
|
||||||
|
string="Reconciliation Accounts"
|
||||||
|
attrs="{'invisible': [('type', '!=', 'bank')]}"
|
||||||
|
>
|
||||||
<field name="account_reconciliation_ids" widget="many2many_tags" />
|
<field name="account_reconciliation_ids" widget="many2many_tags" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -6,7 +6,11 @@
|
|||||||
<field name="inherit_id" ref="account.view_account_form" />
|
<field name="inherit_id" ref="account.view_account_form" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//div/field[@name='reconcile']/.." position="after">
|
<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>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</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