mirror of
https://github.com/bringout/oca-payroll.git
synced 2026-04-23 17:21:59 +02:00
Initial commit: OCA Payroll packages (5 packages)
This commit is contained in:
commit
d19274f581
407 changed files with 214057 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class HrPayslipLine(models.Model):
|
||||
_inherit = "hr.payslip.line"
|
||||
|
||||
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
|
||||
)
|
||||
acc_type = self.salary_rule_id.account_debit.account_type
|
||||
if credit_account:
|
||||
acc_type = self.salary_rule_id.account_credit.account_type
|
||||
if register_partner_id or acc_type in ("asset_receivable", "liability_payable"):
|
||||
return partner_id
|
||||
return False
|
||||
Loading…
Add table
Add a link
Reference in a new issue