Files
gzth/yuthon_salary/models/yuthon_payroll_labor.py
T
2025-04-23 21:12:55 +08:00

30 lines
931 B
Python

from odoo import api, fields, models
class YuthonPayrollLabor(models.Model):
_name = 'yuthon.payroll.labor'
_description = '劳务费'
employee_id = fields.Many2one('hr.employee', string='姓名')
current_year = fields.Integer(string='年份')
date_of_entry = fields.Date(related='employee_id.entry_date', string="入职时间", store=True)
current_month = fields.Selection([
('1', '1月份'),
('2', '2月份'),
('3', '3月份'),
('4', '4月份'),
('5', '5月份'),
('6', '6月份'),
('7', '7月份'),
('8', '8月份'),
('9', '9月份'),
('10', '10月份'),
('11', '11月份'),
('12', '12月份')
], string="月份")
labor_amount = fields.Float(string='金额')
company_id = fields.Many2one(related='employee_id.company_id', string='公司', index=True, default=lambda self: self.env.company)