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

[16.0] [MIG] account_bank_statement_reopen_skip_undo_reconciliation #737

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
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Do NOT update manually; changes here will be overwritten by Copier
_commit: v1.21.1
_commit: v1.27
_src_path: gh:oca/oca-addons-repo-template
ci: GitHub
convert_readme_fragments_to_markdown: false
enable_checklog_odoo: false
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ var/
*.egg
*.eggs

# Windows installers
*.msi

# Debian packages
*.deb

# Redhat packages
*.rpm

# MacOS packages
*.dmg
*.pkg

# Installer logs
pip-log.txt
pip-delete-this-directory.txt
Expand Down
34 changes: 23 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
Expand Down Expand Up @@ -39,7 +39,7 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
rev: 9a170331575a265c092ee6b24b845ec508e8ef75
rev: d5fab7ee87fceee858a3d01048c78a548974d935
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
Expand All @@ -58,6 +58,8 @@ repos:
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
args:
- --disable=po-pretty-format
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
Expand All @@ -73,25 +75,35 @@ repos:
rev: 22.8.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
- repo: local
hooks:
- id: prettier
name: prettier (with plugin-xml)
entry: prettier
args:
- --write
- --list-different
- --ignore-unknown
types: [text]
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
language: node
additional_dependencies:
- "[email protected]"
- "@prettier/[email protected]"
args:
- --plugin=@prettier/plugin-xml
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.24.0
- repo: local
hooks:
- id: eslint
verbose: true
name: eslint
entry: eslint
args:
- --color
- --fix
verbose: true
types: [javascript]
language: node
additional_dependencies:
- "[email protected]"
- "eslint-plugin-jsdoc@"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
Expand Down Expand Up @@ -138,7 +150,7 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 7.1.1
hooks:
- id: flake8
name: flake8
Expand Down
92 changes: 92 additions & 0 deletions account_bank_statement_reopen_skip_undo_reconciliation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
======================================================
Account Bank Statement Reopen Skip Undo Reconciliation
======================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f0f6bd3c88387fdc52174ac0ca11e49d4a4b2fa83a25d7714521ac71e42c522d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--reconcile-lightgray.png?logo=github
:target: https://github.com/OCA/account-reconcile/tree/16.0/account_bank_statement_reopen_skip_undo_reconciliation
:alt: OCA/account-reconcile
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-reconcile-16-0/account-reconcile-16-0-account_bank_statement_reopen_skip_undo_reconciliation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-reconcile&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

After installing this module when you press the button "Reset to New" on a bank
statement that is in status 'Processing' the application will not unreconcile
or set to draft any previous reconciled bank statement lines.

The reconciled bank statement lines remain posted and reconciled. As soon as
you manually unreconcile the line the associated journal entry will be reset
back to the Draft status, if the statement is in "New" status.

This feature improves the usability of the bank statements, as it may be
frequent for a user to adjust the statement lines during the reconciliation
process, needing to Reset the status of the statement back to new in order to
introduce changes.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-reconcile/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-reconcile/issues/new?body=module:%20account_bank_statement_reopen_skip_undo_reconciliation%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* ForgeFlow
* Akretion

Contributors
~~~~~~~~~~~~

* Akretion
* Alexis de Lattre <[email protected]>

* ForgeFlow
* Jordi Ballester Alomar <[email protected]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-reconcile <https://github.com/OCA/account-reconcile/tree/16.0/account_bank_statement_reopen_skip_undo_reconciliation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022 ForgeFlow S.L.
# @author Jordi Ballester <[email protected]>
# Copyright 2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

{
"name": "Account Bank Statement Reopen Skip Undo Reconciliation",
"summary": "When reopening a bank statement it will respect the "
"reconciled entries.",
"version": "16.0.1.0.0",
"author": "ForgeFlow, Akretion, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-reconcile",
"category": "Finance",
"depends": ["account"],
"data": ["views/account_bank_statement_views.xml"],
"license": "AGPL-3",
"installable": True,
"auto_install": False,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_bank_statement_reopen_skip_undo_reconciliation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_bank_statement_reopen_skip_undo_reconciliation
#: model:ir.model,name:account_bank_statement_reopen_skip_undo_reconciliation.model_account_bank_statement
msgid "Bank Statement"
msgstr ""

#. module: account_bank_statement_reopen_skip_undo_reconciliation
#: model:ir.model,name:account_bank_statement_reopen_skip_undo_reconciliation.model_account_bank_statement_line
msgid "Bank Statement Line"
msgstr ""

#. module: account_bank_statement_reopen_skip_undo_reconciliation
#: model:ir.model,name:account_bank_statement_reopen_skip_undo_reconciliation.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_bank_statement_reopen_skip_undo_reconciliation
#: model:ir.model,name:account_bank_statement_reopen_skip_undo_reconciliation.model_account_move_line
msgid "Journal Item"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import account_bank_statement
from . import account_bank_statement_line
from . import account_move_line
from . import account_move
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# Copyright 2022 ForgeFlow S.L.
# @author Jordi Ballester <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import models


class AccountBankStatement(models.Model):
_inherit = "account.bank.statement"

def button_reopen(self):
self = self.with_context(skip_undo_reconciliation=True)
return super(AccountBankStatement, self).button_reopen()
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2022 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <[email protected]>
# Copyright 2022 ForgeFlow S.L.
# @author Jordi Ballester <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).


from odoo import models


class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"

def button_undo_reconciliation(self):
if self._context.get("skip_undo_reconciliation"):
return
res = super(AccountBankStatementLine, self).button_undo_reconciliation()
if self.statement_id.state == "open":
self.move_id.button_draft()
return res
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 ForgeFlow S.L.
# @author Jordi Ballester <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import models


class AccountMove(models.Model):
_inherit = "account.move"

def button_draft(self):
moves_to_draft = self.filtered(lambda m: not m.statement_line_id.is_reconciled)
return super(AccountMove, moves_to_draft).button_draft()
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2022 ForgeFlow S.L.
# @author Jordi Ballester <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import models


class AccountMoveLine(models.Model):
_inherit = "account.move.line"

def remove_move_reconcile(self):
if self._context.get("skip_undo_reconciliation"):
return True
return super(AccountMoveLine, self).remove_move_reconcile()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* Akretion
* Alexis de Lattre <[email protected]>

* ForgeFlow
* Jordi Ballester Alomar <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
After installing this module when you press the button "Reset to New" on a bank
statement that is in status 'Processing' the application will not unreconcile
or set to draft any previous reconciled bank statement lines.

The reconciled bank statement lines remain posted and reconciled. As soon as
you manually unreconcile the line the associated journal entry will be reset
back to the Draft status, if the statement is in "New" status.

This feature improves the usability of the bank statements, as it may be
frequent for a user to adjust the statement lines during the reconciliation
process, needing to Reset the status of the statement back to new in order to
introduce changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading