Skip to content

Commit

Permalink
Merge PR #613 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Dec 28, 2023
2 parents 5c0e421 + f444d14 commit e506103
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 14 deletions.
3 changes: 2 additions & 1 deletion account_reconcile_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Reconcile Oca
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bc5ac758c54a958b23fe3962f890d737b6949c7054be36b79002f62095cfeffc
!! source digest: sha256:3f6bc07a9963be4143fdb984d07e4b6a0542e791f082edb98e907cc000ea0617
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -75,6 +75,7 @@ Authors
~~~~~~~

* CreuBlanca
* Dixmit

Contributors
~~~~~~~~~~~~
Expand Down
4 changes: 2 additions & 2 deletions account_reconcile_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 CreuBlanca
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
Expand All @@ -7,7 +7,7 @@
Reconcile addons for Odoo CE accounting""",
"version": "16.0.1.2.5",
"license": "AGPL-3",
"author": "CreuBlanca,Odoo Community Association (OCA)",
"author": "CreuBlanca,Dixmit,Odoo Community Association (OCA)",
"maintainers": ["etobella"],
"website": "https://github.com/OCA/account-reconcile",
"depends": [
Expand Down
1 change: 1 addition & 0 deletions account_reconcile_oca/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
from . import account_journal
from . import account_bank_statement_line
from . import account_account_reconcile
from . import account_move_line
9 changes: 8 additions & 1 deletion account_reconcile_oca/models/account_account_reconcile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 CreuBlanca
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import api, fields, models
Expand Down Expand Up @@ -84,6 +84,13 @@ def _having(self):
def _compute_reconcile_data_info(self):
data_obj = self.env["account.account.reconcile.data"]
for record in self:
if self.env.context.get("default_account_move_lines"):
data = {
"data": [],
"counterparts": self.env.context.get("default_account_move_lines"),
}
record.reconcile_data_info = self._recompute_data(data)
continue
data_record = data_obj.search(
[("user_id", "=", self.env.user.id), ("reconcile_id", "=", record.id)]
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 CreuBlanca
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from collections import defaultdict
Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 CreuBlanca
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, fields, models
Expand Down
34 changes: 34 additions & 0 deletions account_reconcile_oca/models/account_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, models
from odoo.exceptions import ValidationError


class AccountMoveLine(models.Model):

_inherit = "account.move.line"

def action_reconcile_manually(self):
if not self:
return {}
self.mapped("account_id").ensure_one()
partner = self.mapped("partner_id")
if partner:
partner.ensure_one()
if self.filtered(lambda r: r.partner_id != partner):
raise ValidationError(
_("You must reconcile information on the same partner")
)
action = self.env["ir.actions.act_window"]._for_xml_id(
"account_reconcile_oca.account_account_reconcile_act_window"
)
action["domain"] = [
("account_id", "=", self.mapped("account_id").id),
("partner_id", "=", partner.id),
]
action["context"] = self.env.context.copy()
action["context"]["default_account_move_lines"] = self.filtered(
lambda r: not r.reconciled
).ids
return action
2 changes: 1 addition & 1 deletion account_reconcile_oca/models/account_reconcile_abstract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 CreuBlanca
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models
Expand Down
4 changes: 3 additions & 1 deletion account_reconcile_oca/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -366,7 +367,7 @@ <h1 class="title">Account Reconcile Oca</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:bc5ac758c54a958b23fe3962f890d737b6949c7054be36b79002f62095cfeffc
!! source digest: sha256:3f6bc07a9963be4143fdb984d07e4b6a0542e791f082edb98e907cc000ea0617
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-reconcile/tree/16.0/account_reconcile_oca"><img alt="OCA/account-reconcile" src="https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_reconcile_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon allows to reconcile bank statements and account marked as <cite>reconcile</cite>.</p>
Expand Down Expand Up @@ -423,6 +424,7 @@ <h1><a class="toc-backref" href="#toc-entry-6">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-7">Authors</a></h2>
<ul class="simple">
<li>CreuBlanca</li>
<li>Dixmit</li>
</ul>
</div>
<div class="section" id="contributors">
Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/views/account_account.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/views/account_account_reconcile.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/views/account_journal.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down
2 changes: 1 addition & 1 deletion account_reconcile_oca/views/account_move.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down
11 changes: 10 additions & 1 deletion account_reconcile_oca/views/account_move_line.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2022 CreuBlanca
<!-- Copyright 2023 Dixmit
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>

Expand Down Expand Up @@ -101,4 +101,13 @@
</search>
</field>
</record>

<record id="action_reconcile" model="ir.actions.server">
<field name="name">Reconcile</field>
<field name="model_id" ref="account.model_account_move_line" />
<field name="binding_model_id" ref="account.model_account_move_line" />
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">action = records.action_reconcile_manually()</field>
</record>
</odoo>

0 comments on commit e506103

Please sign in to comment.