From 0b1b4c8d057baa8a45f08ae2a00e84577b50b659 Mon Sep 17 00:00:00 2001 From: "Dylan Kiss (dyki)" Date: Tue, 26 Sep 2023 11:54:43 +0200 Subject: [PATCH] [REV] l10n_dk: force lock of sales and purchase entries We don't want to force anything and make clear that we have 3 solutions the user can choose: hash, lock date and audit trail. This reverts commit 3a5fc92c34d51f880c002de1c954c282d6d855ec. closes odoo/odoo#136625 Signed-off-by: Laurent Smet (las) --- addons/l10n_dk/__manifest__.py | 1 - addons/l10n_dk/models/account_journal.py | 20 ------------------- .../l10n_dk/views/account_journal_views.xml | 13 ------------ 3 files changed, 34 deletions(-) delete mode 100644 addons/l10n_dk/views/account_journal_views.xml diff --git a/addons/l10n_dk/__manifest__.py b/addons/l10n_dk/__manifest__.py index b5b4a083723..880b1f46f34 100644 --- a/addons/l10n_dk/__manifest__.py +++ b/addons/l10n_dk/__manifest__.py @@ -96,7 +96,6 @@ Produkt setup: 'data': [ 'data/account_account_tags.xml', 'data/account_tax_report_data.xml', - 'views/account_journal_views.xml', ], 'demo': [ 'demo/demo_company.xml', diff --git a/addons/l10n_dk/models/account_journal.py b/addons/l10n_dk/models/account_journal.py index b46d9048cb5..571dcf289eb 100644 --- a/addons/l10n_dk/models/account_journal.py +++ b/addons/l10n_dk/models/account_journal.py @@ -19,23 +19,3 @@ class AccountJournal(models.Model): account_vals['tag_ids'].append((4, self.env.ref('l10n_dk.account_tag_liquidity').id)) return account_vals - - def create(self, vals_list): - # EXTENDS account - journals = super().create(vals_list) - for journal in journals: - if journal.type in ('sale', 'purchase') and journal.country_code == 'DK': - # For Denmark we force hashing the entries for sales and purchase journals. - journal.restrict_mode_hash_table = True - return journals - - def write(self, vals): - # EXTENDS account - if 'restrict_mode_hash_table' in vals and not vals['restrict_mode_hash_table']: - for journal in self: - if journal.country_code == 'DK' and journal.type in ('sale', 'purchase'): - # For Denmark we force hashing the entries for sales and purchase journals. - del vals['restrict_mode_hash_table'] - break - res = super().write(vals) - return res diff --git a/addons/l10n_dk/views/account_journal_views.xml b/addons/l10n_dk/views/account_journal_views.xml deleted file mode 100644 index 1adcf5c5a6a..00000000000 --- a/addons/l10n_dk/views/account_journal_views.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - account.journal.view.form.inherit - account.journal - - - - type in ('sale', 'purchase') and country_code == 'DK' - - - -