添加功能

This commit is contained in:
李鹏宇
2025-10-11 19:33:39 +08:00
parent c20349acdf
commit b2a690541c
5 changed files with 15 additions and 7 deletions
@@ -48,6 +48,14 @@
<xpath expr="//field[@name='employee_id']" position="after">
<field name="code"/>
</xpath>
<xpath expr="//field[@name='structure_type_id'][@groups='!hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="domain">['|', ('country_id', '=', False), ('country_id', '=', company_country_id), ('company_id', '=', company_id)]</attribute>
<attribute name="职级"/>
</xpath>
<xpath expr="//field[@name='structure_type_id'][@groups='hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="domain">['|', ('country_id', '=', False), ('country_id', '=', company_country_id), ('company_id', '=', company_id)]</attribute>
<attribute name="职级"/>
</xpath>
<xpath expr="//page[@name='other']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
@@ -180,8 +180,6 @@ class HrAttendance(models.Model):
return True
# @api.model
# def web_read_group(self, domain, fields, groupby, limit=None, offset=0, orderby=False, lazy=True):
# result = super().web_read_group(domain, fields, groupby, limit, offset, orderby, lazy)
@@ -41,7 +41,6 @@ class OvertimeApprovals(models.Model):
default='normal')
active = fields.Boolean('Active', default=True, tracking=True)
work_end = fields.Boolean(string="结束")
test_field = fields.Char(string="测试字段")
def _get_default_name_title(self):
@@ -83,7 +82,6 @@ class OvertimeApprovals(models.Model):
if rec.users_id:
rec.is_thwg = rec.users_id.company_id.name == '天河物管'
@api.depends('start_time', 'end_time', 'attendance_id')
def _compute_duration(self):
for rec in self:
@@ -260,7 +258,11 @@ class OvertimeApprovals(models.Model):
workflow_id = self.env['soong.workflow.record'].search([('code', '=', self.code)], limit=1)
if attendance_record:
attendance_record.write({'is_workflow': True,
'workflow_id': workflow_id.id,
'is_abnormal': False,
'is_no_card': False,
'is_late_card': False,
'is_early_card': False,
'workflow_id': workflow_id.id,
})
@api.depends('users_id', 'duration')
@@ -89,7 +89,7 @@
<field name="duration"/>
<field name="employee_ids" widget="many2many_tags" options="{'no_create': True}"/>
<field name="department_id" invisible="1"/>
<field name="attendance_id" invisible="1"/>
<field name="attendance_id"/>
<field name="is_thwg" invisible="1"/>
<field name="overtime_hours" readonly="1"/>
<field name="meal" required="1" invisible="is_thwg"/>
@@ -72,6 +72,7 @@
<field name="duration_employment_end" class="ms-2" style="max-width: 10rem !important;"/>
</div>
<field name="is_annual_salary"/>
<field name="is_office"/>
</group>
<group>
<field name="department_id1" readonly="0"/>
@@ -94,7 +95,6 @@
<field name="job_id" readonly="0"/>
<field name="structure_type_id" domain="[('company_id', '=', company_id)]"/>
<field name="onboard_time"/>
<field name="is_office"/>
</group>
</group>
<group>