Skip to content

Commit

Permalink
[14.0][ADD]account_reconciliation_widget_limit_aml: Filter all accoun…
Browse files Browse the repository at this point in the history
…t move lines in reconciliation view
  • Loading branch information
manuelregidor committed Sep 19, 2023
1 parent dd4d11a commit af13c22
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 0 deletions.
5 changes: 5 additions & 0 deletions account_reconciliation_widget_limit_aml/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
16 changes: 16 additions & 0 deletions account_reconciliation_widget_limit_aml/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"name": "Account Reconciliation Widget Limit AML",
"version": "14.0.1.0.0",
"category": "Accounting",
"license": "AGPL-3",
"summary": "Filter all account move lines in reconciliation view",
"author": "Sygel, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-reconcile",
"depends": ["account_reconciliation_widget"],
"data": ["views/res_config_settings_views.xml"],
"installable": True,
}
7 changes: 7 additions & 0 deletions account_reconciliation_widget_limit_aml/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import res_company
from . import res_config_settings
from . import reconciliation_widget
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import api, models
from odoo.osv import expression


class AccountReconciliation(models.AbstractModel):
_inherit = "account.reconciliation.widget"

@api.model
def _domain_move_lines_for_reconciliation(
self,
st_line,
aml_accounts,
partner_id,
excluded_ids=None,
search_str=False,
mode="rp",
):
domain = super()._domain_move_lines_for_reconciliation(
st_line, aml_accounts, partner_id, excluded_ids, search_str, mode
)
if (
st_line.company_id.account_bank_reconciliation_start_all_aml
and st_line.company_id.account_bank_reconciliation_start
):
domain = expression.AND(

Check warning on line 29 in account_reconciliation_widget_limit_aml/models/reconciliation_widget.py

View check run for this annotation

Codecov / codecov/patch

account_reconciliation_widget_limit_aml/models/reconciliation_widget.py#L29

Added line #L29 was not covered by tests
[
domain,
[
(
"date",
">=",
st_line.company_id.account_bank_reconciliation_start,
)
],
]
)
return domain
13 changes: 13 additions & 0 deletions account_reconciliation_widget_limit_aml/models/res_company.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResCompany(models.Model):
_inherit = "res.company"

account_bank_reconciliation_start_all_aml = fields.Boolean(
string="Filter all account move lines"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 Valentin Vinagre <valentin.vinagre@sygel.es>
# Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from odoo import fields, models


class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"

account_bank_reconciliation_start_all_aml = fields.Boolean(
related="company_id.account_bank_reconciliation_start_all_aml", readonly=False
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Valentin Vinagre <valentin.vinagre@sygel.es>
* Manuel Regidor <manuel.regidor@sygel.es>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module adds the option to filter all the account move lines by date in the reconciliation view, not only those coming from payments.
2 changes: 2 additions & 0 deletions account_reconciliation_widget_limit_aml/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Go to Invoicing --> Configuration --> Settings
Check the "Filter all account move lines" checkbox. When checked, all the account move lines will be filtered by the selected date.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2023 Manuel Regidor <manuel.regidor@sygel.es>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<data>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field
name="inherit_id"
ref="account_reconciliation_widget.res_config_settings_view_form"
/>
<field name="arch" type="xml">
<xpath
expr="//field[@name='account_bank_reconciliation_start']"
position="after"
>
<br />
<field name="account_bank_reconciliation_start_all_aml" />
<label for="account_bank_reconciliation_start_all_aml" />
</xpath>
</field>
</record>
</data>
</odoo>
6 changes: 6 additions & 0 deletions setup/account_reconciliation_widget_limit_aml/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit af13c22

Please sign in to comment.