[BKP][ADD] account_journal_restrict_mode

This commit is contained in:
JordiMForgeFlow
2024-09-09 15:00:35 +02:00
parent f0214a42b1
commit 56f4b0e27c
5 changed files with 13 additions and 9 deletions

View File

@@ -4,13 +4,11 @@
{
"name": "Account Journal Restrict Mode",
"summary": "Lock All Posted Entries of Journals.",
"version": "16.0.1.0.0",
"version": "13.0.1.0.0",
"author": "ForgeFlow S.L., Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-financial-tools",
"category": "Accounting",
"depends": [
"account",
],
"depends": ["account"],
"license": "AGPL-3",
"data": [],
"installable": True,

View File

@@ -8,7 +8,7 @@ from odoo.exceptions import UserError
class AccountJournal(models.Model):
_inherit = "account.journal"
restrict_mode_hash_table = fields.Boolean(default=True)
restrict_mode_hash_table = fields.Boolean(default=True, readonly=True)
@api.constrains("restrict_mode_hash_table")
def _check_journal_restrict_mode(self):

View File

@@ -6,10 +6,9 @@ from odoo.tests import common
class TestAccountJournalRestrictMode(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestAccountJournalRestrictMode, cls).setUpClass()
cls.account_journal_obj = cls.env["account.journal"]
def setUp(self):
super(TestAccountJournalRestrictMode, self).setUp()
self.account_journal_obj = self.env["account.journal"]
def test_journal_default_lock_entries(self):
journal = self.account_journal_obj.create(

View File

@@ -0,0 +1 @@
../../../../account_journal_restrict_mode

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)