Merge PR #591 into 14.0

Signed-off-by HaraldPanten
This commit is contained in:
OCA-git-bot
2023-09-19 19:21:55 +00:00
13 changed files with 133 additions and 0 deletions

View File

@@ -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

View File

@@ -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,
}

View File

@@ -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

View File

@@ -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(
[
domain,
[
(
"date",
">=",
st_line.company_id.account_bank_reconciliation_start,
)
],
]
)
return domain

View File

@@ -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"
)

View File

@@ -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
)

View File

@@ -0,0 +1,2 @@
* Valentin Vinagre <valentin.vinagre@sygel.es>
* Manuel Regidor <manuel.regidor@sygel.es>

View File

@@ -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.

View File

@@ -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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -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>

View File

@@ -0,0 +1 @@
../../../../account_reconciliation_widget_limit_aml

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)