Skip to Content
Menu
This question has been flagged

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.

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 23
1100
3
Jul 19
4764
1
Mar 24
4857
0
Feb 21
1319
1
Feb 24
820