[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 3a5fc92c34.
closes odoo/odoo#136625
Signed-off-by: Laurent Smet (las) <las@odoo.com>
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="view_account_journal_form_inherit_l10n_dk" model="ir.ui.view">
|
||||
<field name="name">account.journal.view.form.inherit</field>
|
||||
<field name="model">account.journal</field>
|
||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="restrict_mode_hash_table" position="attributes">
|
||||
<attribute name="readonly">type in ('sale', 'purchase') and country_code == 'DK'</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user