[REV] l10n_nl: set 'Cost of Revenue' in allowed account types for Vendor Bills journal created for a l10n_nl chart of account

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) <wan@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
This commit is contained in:
John Laterre (jol)
2022-06-15 06:10:33 +02:00
parent a715e63b88
commit dbc9836dff
-12
View File
@@ -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