Payroll Odoo (version 10):
def _get_partner_id(self, credit_account):
""" Get partner_id of slip line to use in account_move_line """
# use partner of salary rule or fallback on employee's address
register_partner_id = self.salary_rule_id.register_id.partner_id
partner_id = register_partner_id.id or self.slip_id.employee_id.address_home_id.id
if credit_account:
if register_partner_id or self.salary_rule_id.account_credit.internal_type in ('receivable', 'payable'):
return partner_id
else:
if register_partner_id or self.salary_rule_id.account_debit.internal_type in ('receivable', 'payable'):
return partner_id
return False
I checked HR Payroll Account and HR Payroll Module.
- from where partner_id in hr.contribution.register set?
if partner_id will not set than for above method we cant get partner account in any case. So always Adjustment Account entry for Payslip will be generate.
================
if we take partner_id instead of register_partner_id in condition than it will work.
================
Please suggest if there is any functional link or configuration.
Thanks in advance.