From dbc9836dff4c76d57bb0a6b951896d34116fb126 Mon Sep 17 00:00:00 2001 From: "John Laterre (jol)" Date: Tue, 14 Jun 2022 14:19:46 +0000 Subject: [PATCH] [REV] l10n_nl: set 'Cost of Revenue' in allowed account types for Vendor Bills journal created for a l10n_nl chart of account MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit f4235243700d4a52117ca6750c44afb10142bf42. This commit introduced an unwanted effect, by using the `type_control_ids` to allow an account type on a journal. But it was intended as a constraint, to limit the account types allowed on the journal and exclude all the others. In this case, by allowing the type of the account `data_account_type_direct_costs`, it also excluded all other account types on the Vendor Bill journal. closes odoo/odoo#93668 X-original-commit: 60aa39ab988434a80993e503e28a5f4f9a49f815 Signed-off-by: William André (wan) Signed-off-by: John Laterre (jol) --- addons/l10n_nl/models/account_journal.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/addons/l10n_nl/models/account_journal.py b/addons/l10n_nl/models/account_journal.py index 577eb3e5ebd..05b0b51649c 100644 --- a/addons/l10n_nl/models/account_journal.py +++ b/addons/l10n_nl/models/account_journal.py @@ -6,18 +6,6 @@ from odoo import api, fields, models, _ class AccountJournal(models.Model): _inherit = 'account.journal' - @api.model - def _fill_missing_values(self, vals): - super()._fill_missing_values(vals) - - if vals.get('type') != 'purchase': - return - - company = self.env['res.company'].browse(vals['company_id']) if vals.get('company_id') else self.env.company - if company.country_id.code == "NL" and not vals.get('type_control_ids', [(6, 0, [])])[0][2]: - type_control_ids = self.env.ref('account.data_account_type_direct_costs').ids - vals['type_control_ids'] = [(6, 0, type_control_ids)] - @api.model def _prepare_liquidity_account_vals(self, company, code, vals): # OVERRIDE