Merge pull request !2327 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-04-03 07:31:15 +00:00
committed by Gitee
12 changed files with 45 additions and 10 deletions
+1
View File
@@ -13,6 +13,7 @@
'depends': ['hr_contract', 'yuthon_hr_employee', 'base', 'yuthon_salary'],
'data': [
'security/ir.model.access.csv',
'security/company_rule.xml',
'data/contract_code_data.xml',
'wizard/yuthon_contract_wizard_views.xml',
# 'views/inherit_hr_contract_views.xml',
@@ -12,7 +12,7 @@ class HrContract(models.Model):
name = fields.Char(string="合同名称", compute='_compute_name', readonly=False)
resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表')
date_of_entry = fields.Date(related='employee_id.entry_date', string="入职时间")
salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资单分组", store=True, index=True)
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资单分组", store=True, index=True)
work_entry_source = fields.Selection([
('calendar', '考勤安排'),
@@ -46,3 +46,11 @@ class HrContract(models.Model):
"view_mode": "form",
"target": "new",
}
def update_contract(self):
contract_ids = self.env["hr.contract"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for contract in contract_ids:
company_id = contract.employee_id.company_id
contract.write({
'company_id':company_id.id})
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record model="ir.rule" id="yuthon_hr_contract_rule">
<field name="name">合同多公司</field>
<field name="model_id" ref="model_hr_contract"/>
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
</odoo>
@@ -62,6 +62,7 @@ class YuthonHrEmployee(models.Model):
user_origin = fields.Char(string="籍贯")
user_location = fields.Char(string="户口所在地")
is_location = fields.Boolean(string="是否本地")
bank_account = fields.Char(string="银行卡号")
user_location_type = fields.Selection([('formal', '本地农业'), ('labor', '本地非农业'),
('part_time', '外地农业'), ('practice', '外地非农业')], string="户籍类型")
duty_replacement_card = fields.Integer(string="值班补卡次数(月)")
@@ -21,6 +21,12 @@
<xpath expr="//field[@name='work_email']" position="after">
<field name="user_state"/>
</xpath>
<xpath expr="//field[@name='bank_account_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='bank_account_id']" position="after">
<field name="bank_account"/>
</xpath>
<xpath expr="//page[@name='personal_information']" position="replace">
<page name="personal_information" string="个人隐私信息">
<group>
+3 -2
View File
@@ -5,12 +5,13 @@ from odoo.exceptions import ValidationError, UserError
class InheritHrPayslip(models.Model):
_inherit = 'hr.payslip'
company_id = fields.Many2one(related='employee_id.company_id', string="公司")
company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company)
employee_id = fields.Many2one('hr.employee', string="姓名")
base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True)
bank_account = fields.Char(string='银行账号', related='employee_id.bank_account', store=True)
identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True)
card_type = fields.Char(string='证件类型', store=True, default="居民身份证")
salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资组", store=True, index=True)
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资组", store=True, index=True)
performance_bonuses = fields.Float(string='预发绩效奖金', compute='_compute_salary', store=True)
full_attendance_award = fields.Float(string='全勤奖', compute='_compute_salary', store=True)
commuting_allowance = fields.Float(string='通信补贴', compute='_compute_salary', store=True)
@@ -10,7 +10,7 @@ class YuthonPayrollCommon(models.Model):
_order = 'sequence asc'
yuthon_company = fields.Selection([('thtz', 'thtz')], default="thtz")
company_id = fields.Many2one('res.company', string="公司")
company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company)
name = fields.Char(string='工资项名称')
sequence = fields.Char(string='序号', store=True)
department_id = fields.Many2one('hr.department', string="部门")
@@ -22,7 +22,7 @@
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field name="sequence"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="type_id"/>
<field name="level_id" column_invisible="1"/>
<field name="lv_name" column_invisible="1"/>
@@ -262,6 +262,16 @@
</xpath>
</field>
</record>
<record id="inherit_view_hr_payslip_tree" model="ir.ui.view">
<field name="name">inherit.view.hr.payslip.tree</field>
<field name="model">hr.payslip</field>
<field name="inherit_id" ref="hr_payroll.view_hr_payslip_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='employee_id']" position="attributes">
<field name="bank_account"/>
</xpath>
</field>
</record>
<record id="hr_payroll.action_view_hr_payslip_month_form" model="ir.actions.act_window">
<field name="name">薪资审定</field>
<field name="res_model">hr.payslip</field>
@@ -8,7 +8,7 @@
<field name="employee_id" domain="[('use_user_type', '=', 'labor')]"/>
<field name="current_year" optional="hide"/>
<field name="current_month" optional="hide"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="labor_amount"/>
</tree>
</field>
@@ -7,7 +7,7 @@
<tree string="薪资常用项" editable="bottom">
<field name="sequence"/>
<field name="name"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="before_tax"/>
<field name="attributes"/>
<field name="department_id"/>
@@ -38,7 +38,7 @@
<field name="arch" type="xml">
<tree string="临时工资项" editable="bottom">
<field name="name"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="attributes"/>
<field name="department_id"/>
<field name="is_before_tax"/>
@@ -58,7 +58,7 @@
<field name="arch" type="xml">
<tree string="五险一金" editable="bottom">
<field name="name"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="is_base"/>
<field name="proportion_company"/>
<field name="proportion_employee"/>
@@ -8,7 +8,7 @@
<field name="name"/>
<field name="current_year" optional="hide"/>
<field name="current_month" optional="hide"/>
<field name="company_id" required="1"/>
<field name="company_id" required="1" optional="hide"/>
<field name="retired_amount"/>
</tree>
</field>