diff --git a/account_journal_restrict_mode/__manifest__.py b/account_journal_restrict_mode/__manifest__.py index 2367bf15360..e4c6d09071d 100644 --- a/account_journal_restrict_mode/__manifest__.py +++ b/account_journal_restrict_mode/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Account Journal Restrict Mode", "summary": "Lock All Posted Entries of Journals.", - "version": "17.0.1.0.0", + "version": "18.0.1.0.0", "author": "ForgeFlow S.L., Odoo Community Association (OCA)", "website": "https://github.com/OCA/account-financial-tools", "category": "Accounting", diff --git a/account_journal_restrict_mode/models/account_journal.py b/account_journal_restrict_mode/models/account_journal.py index 9bbabf681f8..3ac8818e736 100644 --- a/account_journal_restrict_mode/models/account_journal.py +++ b/account_journal_restrict_mode/models/account_journal.py @@ -15,15 +15,7 @@ def _check_journal_restrict_mode(self): for rec in self: if not rec.restrict_mode_hash_table: raise UserError( - _("Journal %s must have Lock Posted Entries enabled.") % rec.name + self.env._("Journal %s must have Lock Posted Entries enabled.") % rec.name ) - @api.model_create_multi - def create(self, vals_list): - # Proposed fix to odoo https://github.com/odoo/odoo/pull/147738. - # But while they don't merge (as it's not an issue they will face in Odoo standard...) - journals = super().create(vals_list) - for journal in journals: - if journal.restrict_mode_hash_table and not journal.secure_sequence_id: - journal._create_secure_sequence(["secure_sequence_id"]) - return journals + diff --git a/account_journal_restrict_mode/tests/test_account_journal_restrict_mode.py b/account_journal_restrict_mode/tests/test_account_journal_restrict_mode.py index 9d2c6837fd8..112a860059c 100644 --- a/account_journal_restrict_mode/tests/test_account_journal_restrict_mode.py +++ b/account_journal_restrict_mode/tests/test_account_journal_restrict_mode.py @@ -10,8 +10,8 @@ @tagged("post_install", "-at_install") class TestAccountJournalRestrictMode(AccountTestInvoicingCommon): @classmethod - def setUpClass(cls, chart_template_ref=None): - super().setUpClass(chart_template_ref=chart_template_ref) + def setUpClass(cls): + super().setUpClass() cls.account_journal_obj = cls.env["account.journal"] cls.company_obj = cls.env["res.company"] cls.currency_obj = cls.env["res.currency"] @@ -26,24 +26,3 @@ def test_journal_default_lock_entries(self): with self.assertRaises(UserError): journal.write({"restrict_mode_hash_table": False}) - def test_journal_default_secure_sequence_new_company(self): - test_company = self.company_obj.create( - { - "name": "My Test Company", - "currency_id": self.currency_obj.search([("name", "=", "USD")]).id, - "country_id": self.country_be.id, - } - ) - self.chart_template_obj.try_loading( - template_code="generic_coa", company=test_company, install_demo=False - ) - journals = self.env["account.journal"].search( - [("company_id", "=", test_company.id)] - ) - self.assertTrue(journals) - self.assertTrue( - all( - journal.restrict_mode_hash_table and journal.secure_sequence_id - for journal in journals - ) - )