Skip to content

Commit

Permalink
[MIG] account_lock_to_date: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech committed May 14, 2024
1 parent 6a6f21e commit 6844615
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
15 changes: 9 additions & 6 deletions account_lock_to_date/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Lock To Date
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e1b6fa78cd63cddec7e69a2e8685a9a34de952b61151bae03e5880a3a32ca5e7
!! source digest: sha256:d9c89dea8edd605f8e986c2c2932c4ed82c20498b0eb130cb476013084315d1e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -17,13 +17,13 @@ Account Lock To Date
: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--financial--tools-lightgray.png?logo=github
:target: https://github.com/OCA/account-financial-tools/tree/15.0/account_lock_to_date
:target: https://github.com/OCA/account-financial-tools/tree/16.0/account_lock_to_date
:alt: OCA/account-financial-tools
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_lock_to_date
:target: https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_lock_to_date
: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-financial-tools&target_branch=15.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-tools&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -54,7 +54,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-tools/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-financial-tools/issues/new?body=module:%20account_lock_to_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_lock_to_date%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.

Expand All @@ -71,6 +71,9 @@ Contributors

* ForgeFlow <https://www.ForgeFlow.com>
** Jordi Ballester Alomar <jordi.ballester@ForgeFlow.com>
* `Aion Tech <https://aiontech.company/>`_:

* Simone Rubino <simone.rubino@aion-tech.it>

Maintainers
~~~~~~~~~~~
Expand All @@ -85,6 +88,6 @@ 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-financial-tools <https://github.com/OCA/account-financial-tools/tree/15.0/account_lock_to_date>`_ project on GitHub.
This module is part of the `OCA/account-financial-tools <https://github.com/OCA/account-financial-tools/tree/16.0/account_lock_to_date>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 2 additions & 1 deletion account_lock_to_date/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Copyright 2019 ForgeFlow S.L.
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Lock To Date",
"summary": """
Allows to set an account lock date in the future.""",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-tools",
Expand Down
3 changes: 3 additions & 0 deletions account_lock_to_date/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
* ForgeFlow <https://www.ForgeFlow.com>
** Jordi Ballester Alomar <jordi.ballester@ForgeFlow.com>
* `Aion Tech <https://aiontech.company/>`_:

* Simone Rubino <simone.rubino@aion-tech.it>
13 changes: 8 additions & 5 deletions account_lock_to_date/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?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 @@ -367,9 +366,9 @@ <h1 class="title">Account Lock To Date</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e1b6fa78cd63cddec7e69a2e8685a9a34de952b61151bae03e5880a3a32ca5e7
!! source digest: sha256:d9c89dea8edd605f8e986c2c2932c4ed82c20498b0eb130cb476013084315d1e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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-financial-tools/tree/15.0/account_lock_to_date"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-15-0/account-financial-tools-15-0-account_lock_to_date"><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-financial-tools&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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-financial-tools/tree/16.0/account_lock_to_date"><img alt="OCA/account-financial-tools" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-tools-16-0/account-financial-tools-16-0-account_lock_to_date"><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-financial-tools&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 module allows to set a Period and Fiscal year Locking end dates. This
will prevent users from posting journal entries on a date after the defined
period or fiscal year end date.</p>
Expand Down Expand Up @@ -399,7 +398,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-tools/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_lock_to_date%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/account-financial-tools/issues/new?body=module:%20account_lock_to_date%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -418,6 +417,10 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<dd>** Jordi Ballester Alomar &lt;<a class="reference external" href="mailto:jordi.ballester&#64;ForgeFlow.com">jordi.ballester&#64;ForgeFlow.com</a>&gt;</dd>
</dl>
</li>
<li><a class="reference external" href="https://aiontech.company/">Aion Tech</a>:<ul>
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;aion-tech.it">simone.rubino&#64;aion-tech.it</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -427,7 +430,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/15.0/account_lock_to_date">OCA/account-financial-tools</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-tools/tree/16.0/account_lock_to_date">OCA/account-financial-tools</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
22 changes: 15 additions & 7 deletions account_lock_to_date/tests/test_account_lock_to_date_update.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2019 ForgeFlow S.L.
# Copyright 2023 Simone Rubino - Aion Tech
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from datetime import datetime
Expand Down Expand Up @@ -28,23 +29,23 @@ def setUp(self):
"company_id": self.company.id,
}
)
self.account_type_recv = self.env.ref("account.data_account_type_receivable")
self.account_type_rev = self.env.ref("account.data_account_type_revenue")
self.account_type_recv = "asset_receivable"
self.account_type_rev = "income"

self.account_recv = self.AccountObj.create(
{
"code": "RECV_DR",
"code": "RECVDR",
"name": "Receivable (test)",
"reconcile": True,
"user_type_id": self.account_type_recv.id,
"account_type": self.account_type_recv,
}
)
self.account_sale = self.AccountObj.create(
{
"code": "SALE_DR",
"code": "SALEDR",
"name": "Receivable (sale)",
"reconcile": True,
"user_type_id": self.account_type_rev.id,
"account_type": self.account_type_rev,
}
)

Expand Down Expand Up @@ -115,9 +116,16 @@ def test_03_create_move_outside_period(self):
locked date"""
self.company.period_lock_to_date = "2900-01-01"
self.company.fiscalyear_lock_to_date = "2900-02-01"
user = self.demo_user
adviser_group = self.adviser_group
self.assertTrue(user in adviser_group.users)
user.groups_id -= adviser_group
# pre-condition
self.assertFalse(user in adviser_group.users)

move = self.create_account_move("2900-01-01")
with self.assertRaises(ValidationError):
move.with_user(self.demo_user.id).action_post()
move.with_user(user.id).action_post()

def test_04_create_move_inside_period(self):
"""We test that we can successfully create a journal entry
Expand Down

0 comments on commit 6844615

Please sign in to comment.