mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[MIG] account_lock_to_date: Migration to 16.0
This commit is contained in:
@@ -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
|
||||
@@ -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|
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
~~~~~~~~~~~
|
||||
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
@@ -367,9 +366,9 @@ ul.auto-toc {
|
||||
!! 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&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&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>
|
||||
@@ -399,7 +398,7 @@ journal entries on the date “Lock To Date” or after.</p>
|
||||
<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">
|
||||
@@ -418,6 +417,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<dd>** Jordi Ballester Alomar <<a class="reference external" href="mailto:jordi.ballester@ForgeFlow.com">jordi.ballester@ForgeFlow.com</a>></dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><a class="reference external" href="https://aiontech.company/">Aion Tech</a>:<ul>
|
||||
<li>Simone Rubino <<a class="reference external" href="mailto:simone.rubino@aion-tech.it">simone.rubino@aion-tech.it</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
@@ -427,7 +430,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<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>
|
||||
|
||||
@@ -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
|
||||
@@ -28,23 +29,23 @@ class TestAccountLockToDateUpdate(TransactionCase):
|
||||
"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,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -115,9 +116,16 @@ class TestAccountLockToDateUpdate(TransactionCase):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user