Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0] Enable Contract level analytic account #85

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hr_payroll_account_community/models/hr_payroll_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def action_payslip_done(self):
continue
debit_account_id = line.salary_rule_id.account_debit.id
credit_account_id = line.salary_rule_id.account_credit.id

cost_center = slip.contract_id.analytic_account_id.id or line.salary_rule_id.analytic_account_id.id
if debit_account_id:
debit_line = (0, 0, {
'name': line.name,
Expand All @@ -86,7 +86,7 @@ def action_payslip_done(self):
'date': date,
'debit': amount > 0.0 and amount or 0.0,
'credit': amount < 0.0 and -amount or 0.0,
'analytic_account_id': line.salary_rule_id.analytic_account_id.id,
'analytic_account_id': cost_center,
'tax_line_id': line.salary_rule_id.account_tax_id.id,
})
line_ids.append(debit_line)
Expand All @@ -100,7 +100,7 @@ def action_payslip_done(self):
'date': date,
'debit': amount < 0.0 and -amount or 0.0,
'credit': amount > 0.0 and amount or 0.0,
'analytic_account_id': line.salary_rule_id.analytic_account_id.id,
'analytic_account_id': cost_center,
'tax_line_id': line.salary_rule_id.account_tax_id.id,
})
line_ids.append(credit_line)
Expand Down