mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'mig/12.0/l10n_us_hr_payroll__2020' into '12.0-test'
mig/12.0/l10n_us_hr_payroll__2020 into 12.0-test See merge request hibou-io/hibou-odoo/suite!239
This commit is contained in:
@@ -76,6 +76,8 @@ def migrate(cr, installed_version):
|
|||||||
|
|
||||||
# Some added rules should have the same accounting side effects of other migrated rules
|
# Some added rules should have the same accounting side effects of other migrated rules
|
||||||
# To ease the transition, we will copy the accounting fields from one to the other.
|
# To ease the transition, we will copy the accounting fields from one to the other.
|
||||||
|
rule_model = env['hr.salary.rule']
|
||||||
|
if hasattr(rule_model, 'account_debit'):
|
||||||
for source, destinations in XMLIDS_COPY_ACCOUNTING_2020.items():
|
for source, destinations in XMLIDS_COPY_ACCOUNTING_2020.items():
|
||||||
source_rule = env.ref(source, raise_if_not_found=False)
|
source_rule = env.ref(source, raise_if_not_found=False)
|
||||||
if source_rule:
|
if source_rule:
|
||||||
@@ -86,4 +88,6 @@ def migrate(cr, installed_version):
|
|||||||
destination_rule.write({
|
destination_rule.write({
|
||||||
'account_debit': source_rule.account_debit.id,
|
'account_debit': source_rule.account_debit.id,
|
||||||
'account_credit': source_rule.account_credit.id,
|
'account_credit': source_rule.account_credit.id,
|
||||||
|
'account_tax_id': source_rule.account_tax_id.id,
|
||||||
|
'analytic_account_id': source_rule.analytic_account_id.id,
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user