odoo - 在 LeaveForm 的 TimeOff 模块中添加休假类型的组合?Odoo13
问题描述
我需要在 TimeOff 模块表单中添加一个可以组合两种休假类型的功能,并且当用户提交表单时,休假会从相应的休假类型中扣除。(在表格中,我正在考虑添加第二个下拉菜单,他/她可以在其中添加其他时间)。
我正在使用 Odoo13,我正在继承模块,但无法弄清楚添加一个下拉列表,用户可以在其中选择多个叶子。
模型=hr.leave,externalid = hr_holidays.hr_leave_view_form
我做过的工作:
我在 Odoo13 中创建了一个继承 hr_holidays 模块的模块,在请假表单中,我成功添加了上面的下拉菜单,但它选择了上面选择的相同休假类型。
这是xml文件:
<?xml version='1.0' encoding='UTF-8' ?>
<odoo>
<!--Adding the Drop Down-->
<record id="hr_leave_view_form_addnewleave" model="ir.ui.view">
<field name="name">leave.addleave</field>
<field name="model">hr.leave</field>
<field name="inherit_id" ref="hr_holidays.hr_leave_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='description']" position="before">
<div class="row" name="status_id">
<label class="col-2 mr-0" for="holiday_status_id"/>
<!-- RLI FIXME: we should avoid redefining the domain in the view when there already is a domain on the model -->
<field name="holiday_status_id" domain="['&', ('virtual_remaining_leaves', '>', 0), '|', ('allocation_type', 'in', ['fixed_allocation', 'no']),'&',('allocation_type', '=', 'fixed'), ('max_leaves', '>', '0')]" context="{'employee_id':employee_id, 'default_date_from':date_from}" options="{'no_create': True, 'no_open': True}" class="col-9 pl-0" nolabel="1"/>
</div>
</xpath>
</field>
</record>
</odoo>
在此代码用于下拉菜单。
提前致谢。请查看我上传的照片。
解决方案
推荐阅读
- android - android + tflite:直接从 GPU 内存中获取相机直播图像到 tflite 模型(更快)
- javascript - 在部分 jira 中执行 AJS
- javascript - 获取数据后尝试渲染组件时出现跨域错误
- android - Kotlin File.readtext() 调用使 Android 应用程序崩溃
- sockets - 如果我一直在套接字中写入并且有时在我的后端读取会发生什么
- angular - 如何将枚举值绑定到 ng-select 标记?
- android - 将 wav 文件拆分为 Android 应用程序的多个文件
- unity3d - UnityEngine.Networking.NetworkTransport:发送错误连接
- video - 响应式视频的 html 代码并排在 https://www.vidyaonline.co/courses/class-2/ 上不起作用
- xslt - 使用 XSLT 合并来自两个节点集的数据