Files
odoo_source/addons/l10n_dk/models/template_dk.py
T
Antoine Boonen 5e2e842d7e [IMP] product: Keep expense and income accounts empty at product creation.
Problem
---------
Before 16.2, the fields were empty, which meant that the expense and
income accounts of the chosen category could be used.
Since 16.2, when a product is created, the expense and income accounts
are automatically pre-filled.

Objective
---------
This task aims at retrieving the old behavior to allow using category 
accounts.

Solution
---------
Remove the `property_account_expense_id` &
`property_account_income_id keys` in `_get_xx_template_data` in all
localization packages that define them.

task-3438931

closes odoo/odoo#134796

X-original-commit: dae46c926d5e63683968107f06bf2bfb8e07d267
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-09-08 11:12:41 +00:00

39 lines
1.6 KiB
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo.addons.account.models.chart_template import template
class AccountChartTemplate(models.AbstractModel):
_inherit = 'account.chart.template'
@template('dk')
def _get_dk_template_data(self):
return {
'property_account_receivable_id': 'dk_coa_5960',
'property_account_payable_id': 'dk_coa_7180',
'property_account_expense_categ_id': 'dk_coa_1610',
'property_account_income_categ_id': 'dk_coa_1010',
'property_tax_payable_account_id': 'dk_coa_7840',
'property_tax_receivable_account_id': 'dk_coa_6320',
'use_anglo_saxon': True,
'code_digits': '4',
}
@template('dk', 'res.company')
def _get_dk_res_company(self):
return {
self.env.company.id: {
'account_fiscal_country_id': 'base.dk',
'bank_account_code_prefix': '682',
'cash_account_code_prefix': '681',
'transfer_account_code_prefix': '683',
'account_default_pos_receivable_account_id': 'dk_coa_5961',
'income_currency_exchange_account_id': 'dk_coa_3610',
'expense_currency_exchange_account_id': 'dk_coa_3610',
'account_journal_early_pay_discount_loss_account_id': 'dk_coa_3790',
'account_journal_early_pay_discount_gain_account_id': 'dk_coa_3570',
'account_sale_tax_id': 'tax110',
'account_purchase_tax_id': 'tax400',
},
}