From 853383cabdd0bcc09b4269586966a0ccc59ba3bb Mon Sep 17 00:00:00 2001 From: Simone Rubino Date: Fri, 29 Sep 2023 14:31:00 +0200 Subject: [PATCH] [MIG] account_lock_to_date: Migration to 16.0 --- account_lock_to_date/README.rst | 15 ++++++++----- account_lock_to_date/__manifest__.py | 3 ++- account_lock_to_date/readme/CONTRIBUTORS.rst | 3 +++ .../static/description/index.html | 13 ++++++----- .../tests/test_account_lock_to_date_update.py | 22 +++++++++++++------ 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/account_lock_to_date/README.rst b/account_lock_to_date/README.rst index 43e0cf16b..edbeed48b 100644 --- a/account_lock_to_date/README.rst +++ b/account_lock_to_date/README.rst @@ -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 `_. 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -71,6 +71,9 @@ Contributors * ForgeFlow ** Jordi Ballester Alomar +* `Aion Tech `_: + + * Simone Rubino 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 `_ project on GitHub. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_lock_to_date/__manifest__.py b/account_lock_to_date/__manifest__.py index 10f7171fd..e662bbfa7 100644 --- a/account_lock_to_date/__manifest__.py +++ b/account_lock_to_date/__manifest__.py @@ -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", diff --git a/account_lock_to_date/readme/CONTRIBUTORS.rst b/account_lock_to_date/readme/CONTRIBUTORS.rst index 33d198fd3..7ce03b5a8 100644 --- a/account_lock_to_date/readme/CONTRIBUTORS.rst +++ b/account_lock_to_date/readme/CONTRIBUTORS.rst @@ -1,2 +1,5 @@ * ForgeFlow ** Jordi Ballester Alomar +* `Aion Tech `_: + + * Simone Rubino diff --git a/account_lock_to_date/static/description/index.html b/account_lock_to_date/static/description/index.html index 7b9e770cd..c6732afad 100644 --- a/account_lock_to_date/static/description/index.html +++ b/account_lock_to_date/static/description/index.html @@ -1,4 +1,3 @@ - @@ -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 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/account-financial-tools Translate me on Weblate Try me on Runboat

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.

@@ -399,7 +398,7 @@ journal entries on the date “Lock To Date” or after.

Bugs are tracked on GitHub 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.

+feedback.

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

@@ -418,6 +417,10 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
** Jordi Ballester Alomar <jordi.ballester@ForgeFlow.com>
+
  • Aion Tech: +
  • @@ -427,7 +430,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

    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 project on GitHub.

    +

    This module is part of the OCA/account-financial-tools project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    diff --git a/account_lock_to_date/tests/test_account_lock_to_date_update.py b/account_lock_to_date/tests/test_account_lock_to_date_update.py index d6bdd2c2e..c99f1c1c0 100644 --- a/account_lock_to_date/tests/test_account_lock_to_date_update.py +++ b/account_lock_to_date/tests/test_account_lock_to_date_update.py @@ -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