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

[14.0][IMP] account_reconciliation_widget: added option to filter all accont move lines #583

Closed
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
16 changes: 16 additions & 0 deletions account_reconciliation_widget/models/reconciliation_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,22 @@ def _domain_move_lines_for_reconciliation(
("balance", "!=", 0.0),
("parent_state", "=", "posted"),
]
if (
st_line.company_id.account_bank_reconciliation_start_all_aml
and st_line.company_id.account_bank_reconciliation_start
):
domain_matching = expression.AND(
[
domain_matching,
[
(
"date",
">=",
st_line.company_id.account_bank_reconciliation_start,
)
],
]
)

domain = expression.OR([domain_reconciliation, domain_matching])
if partner_id:
Expand Down
3 changes: 3 additions & 0 deletions account_reconciliation_widget/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ class ResCompany(models.Model):
"for some time and don't want to reconcile all the past payments with "
"bank statements.",
)
account_bank_reconciliation_start_all_aml = fields.Boolean(
string="Filter all account move lines"
)
7 changes: 6 additions & 1 deletion account_reconciliation_widget/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
* Tecnativa - Pedro M. Baeza
* `Tecnativa <https://www.tecnativa.com>`__:

* Pedro M. Baeza
* `Sygel <https://www.sygel.es>`__:

* Valentin Vinagre
3 changes: 3 additions & 0 deletions account_reconciliation_widget/wizards/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ class ResConfigSettings(models.TransientModel):
account_bank_reconciliation_start = fields.Date(
related="company_id.account_bank_reconciliation_start", readonly=False
)
account_bank_reconciliation_start_all_aml = fields.Boolean(
related="company_id.account_bank_reconciliation_start_all_aml", readonly=False
)
36 changes: 20 additions & 16 deletions account_reconciliation_widget/wizards/res_config_settings_views.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2022 Akretion France (http://www.akretion.com/)
Copyright 2023 Valentin Vinagre <[email protected]>
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>

<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='bank_cash']" position="inside">
<div
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[@id='bank_cash']" position="inside">
<div
class="col-xs-12 col-md-6 o_setting_box"
id="account_bank_reconciliation_start"
>
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<label for="account_bank_reconciliation_start" />
<div class="text-muted">
Date from which you started using bank statements in Odoo. Leave empty if you've been using bank statements in Odoo from the start.
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<label for="account_bank_reconciliation_start" />
<div class="text-muted">
Date from which you started using bank statements in Odoo. Leave empty if you've been using bank statements in Odoo from the start.
</div>
<field name="account_bank_reconciliation_start" />
<br />
<field name="account_bank_reconciliation_start_all_aml" />
<label for="account_bank_reconciliation_start_all_aml" />
</div>
<field name="account_bank_reconciliation_start" />
</div>
</div>
</xpath>
</field>
</record>
</xpath>
</field>
</record>

</odoo>
Loading