Merge pull request !10306 from 李鹏宇/dev
This commit is contained in:
@@ -984,6 +984,29 @@ class HolidaysRequestBatch(models.Model):
|
||||
_(f"天河物管休假时长必须为 2、4、6 或 8 小时才可以保存!")
|
||||
)
|
||||
|
||||
if record.hour_leave_ids and record.company_id.name == '集团本部':
|
||||
for line in record.hour_leave_ids:
|
||||
if not line.request_date_from or not line.request_hour_to:
|
||||
continue
|
||||
match = re.search(r'(\d+(?:\.\d+)?)', line.number_of_hours_text or '')
|
||||
if not match:
|
||||
raise UserError(
|
||||
_("无法提取有效小时数!"))
|
||||
daily_hours = float(match.group(1))
|
||||
if daily_hours == 0.0:
|
||||
raise UserError(
|
||||
_("请假小时数不能为0!"))
|
||||
|
||||
# ===================== 核心修改 =====================
|
||||
# 校验是否为 1 的倍数(整数小时)
|
||||
if not daily_hours.is_integer():
|
||||
raise UserError(
|
||||
_("集团本部休假时长必须为 1 的整数倍才可以保存!")
|
||||
)
|
||||
# ====================================================
|
||||
|
||||
|
||||
|
||||
total_annual_leave_days = 0.0 # 年假总天数
|
||||
total_compensatory_leave_days = 0.0 # 补休总天数
|
||||
for leave_line in record.leave_ids:
|
||||
|
||||
@@ -68,11 +68,13 @@
|
||||
<field name="holiday_allowance2" readonly="1" invisible="not holiday_allowance2"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" groups="yuthon_salary.group_jtbb_user,yuthon_salary.group_wg_user">
|
||||
<field name="is_entrusted" invisible="not entrusted_agent_id"/>
|
||||
<group groups="yuthon_salary.group_jtbb_user,yuthon_salary.group_wg_user" invisible="not entrusted_agent_id">
|
||||
<label for="is_entrusted"/>
|
||||
<div><field name="is_entrusted"/></div>
|
||||
</group>
|
||||
<group col="1">
|
||||
<field name="is_day"/>
|
||||
<group>
|
||||
<label for="is_day"/>
|
||||
<div><field name="is_day"/></div>
|
||||
</group>
|
||||
<!-- <field name="leave_ids" invisible="not is_day"-->
|
||||
<!-- context="{-->
|
||||
@@ -178,8 +180,9 @@
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
<group col="1">
|
||||
<field name="is_hour"/>
|
||||
<group>
|
||||
<label for="is_hour"/>
|
||||
<div><field name="is_hour"/></div>
|
||||
</group>
|
||||
<field name="hour_leave_ids" invisible="not is_hour" string=" "
|
||||
mode="form,tree,kanban"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<field name="name">yuthon.medical.manage.tree</field>
|
||||
<field name="model">yuthon.medical.manage</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="体检费管理" editable="bottom" default_order="entry_date desec">
|
||||
<tree string="体检费管理" editable="bottom" default_order="entry_date desc">
|
||||
<header>
|
||||
<button name="property_reimbursement_form" string="提交体检费报销审批" type="object"
|
||||
class="oe_highlight"/>
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
</h1>
|
||||
</div>
|
||||
<group string="申请信息" col="2">
|
||||
<field name="users_id"/>
|
||||
<label for="borrow_gongzhang" string="借出类型"/>
|
||||
<div style="display:flex; flex-wrap:wrap; gap:8px 20px; align-items:center; padding:4px 0;">
|
||||
<div style="display:inline-flex; align-items:center; gap:4px; white-space:nowrap;">
|
||||
|
||||
Reference in New Issue
Block a user