添加功能
This commit is contained in:
@@ -305,7 +305,7 @@ class HolidaysRequestBatch(models.Model):
|
||||
column1='leave_id',
|
||||
column2='attachment_id'
|
||||
)
|
||||
holiday_allowance = fields.Text(string="常用假期额度", compute='_compute_holiday_allowance', store=True)
|
||||
holiday_allowance = fields.Char(string="常用假期额度", compute='_compute_holiday_allowance', store=True)
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
|
||||
def _get_default_name_title(self):
|
||||
@@ -409,8 +409,7 @@ class HolidaysRequestBatch(models.Model):
|
||||
number_of_days = int(leave_id.number_of_days)
|
||||
else:
|
||||
number_of_days = 0
|
||||
record.holiday_allowance = (f"1.年假分配{number_of_days}天\n"
|
||||
f"2.加班{all_overtime_hours}小时")
|
||||
record.holiday_allowance = (f"可用额度:年假{number_of_days}天,补休{all_overtime_hours}小时")
|
||||
|
||||
class HrLeaveLine(models.Model):
|
||||
_name = 'hr.leave.line'
|
||||
|
||||
@@ -23,8 +23,7 @@ class HrAttendance(models.Model):
|
||||
user_id = fields.Many2one(related='employee_id.user_id', store=True)
|
||||
absenteeism_card = fields.Boolean(string="旷工", group_operator='count_true')
|
||||
work_time_type = fields.Selection([('close_day', '休息日'), ('work_day', '工作日')], string="工作时间类型")
|
||||
company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company)
|
||||
real_company_id = fields.Many2one(related='employee_id.company_id', store=True, string='公司')
|
||||
company_id = fields.Many2one(related='employee_id.company_id', string='公司', index=True, store=True)
|
||||
on_card_location = fields.Char(string="上班打卡地点")
|
||||
down_card_location = fields.Char(string="下班打卡地点")
|
||||
out_card_time = fields.Datetime(string="外出打卡时间")
|
||||
@@ -41,6 +40,8 @@ class HrAttendance(models.Model):
|
||||
night_duty = fields.Datetime(string="晚值")
|
||||
is_approval = fields.Boolean(string="是否审批修正", default=False)
|
||||
|
||||
|
||||
|
||||
# @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)
|
||||
|
||||
@@ -38,7 +38,8 @@ class HrAttendanceDetail(models.Model):
|
||||
|
||||
name = fields.Char(related='employee_id.name')
|
||||
employee_id = fields.Many2one('hr.employee', string="员工", readonly=True)
|
||||
department_id = fields.Many2one('hr.department', string="部门", related="employee_id.department_id", readonly=True)
|
||||
company_id = fields.Many2one('res.company', string="公司", related="employee_id.company_id", store=True)
|
||||
department_id = fields.Many2one('hr.department', string="部门", related="employee_id.department_id", readonly=True, store=True)
|
||||
userid = fields.Char(string='userid')
|
||||
groupname = fields.Char(string='打卡规则名称')
|
||||
checkin_type = fields.Char(string='打卡类型')
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
<field name="model_id" ref="model_hr_attendance_month"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
|
||||
<record id="module_he_attendance_sign" model="ir.module.category">
|
||||
<field name="name">考勤记录详情组</field>
|
||||
</record>
|
||||
@@ -116,5 +115,15 @@
|
||||
<field name="category_id" ref="module_he_attendance_sign"/>
|
||||
<field name="users" eval="[(4, ref('base.user_admin'))]"/>
|
||||
</record>
|
||||
<record model="ir.rule" id="hr_attendance_detail_rule">
|
||||
<field name="name">打卡详情公司过滤</field>
|
||||
<field name="model_id" ref="model_hr_attendance_detail"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
<record model="ir.rule" id="hr_attendance_rule">
|
||||
<field name="name">考勤记录多公司</field>
|
||||
<field name="model_id" ref="model_hr_attendance"/>
|
||||
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<button name="get_hr_attendance_time" type="object" string="手动计算" display="always"/>
|
||||
</header>
|
||||
<field name="employee_id" widget="ztree_select"/>
|
||||
<field name="company_id"/>
|
||||
<field name="department_id" widget="ztree_select"/>
|
||||
<field name="groupname"/>
|
||||
<field name="checkin_type"/>
|
||||
@@ -51,6 +52,7 @@
|
||||
<sheet>
|
||||
<group>
|
||||
<field name="employee_id" widget="ztree_select"/>
|
||||
<field name="company_id"/>
|
||||
<field name="department_id" widget="ztree_select"/>
|
||||
<field name="groupname"/>
|
||||
<field name="checkin_type"/>
|
||||
@@ -64,11 +66,23 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_hr_attendance_detail_search" model="ir.ui.view">
|
||||
<field name="name">hr.attendance.detail.search</field>
|
||||
<field name="model">hr.attendance.detail</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="hr attendance detail">
|
||||
<field name="employee_id"/>
|
||||
<group expand="0" name="group_by" string="Group By">
|
||||
<filter string="公司" name="group_by_company_id" domain="[]" context="{'group_by' : 'company_id'}"/>
|
||||
<filter string="部门" name="group_by_department_id" domain="[]" context="{'group_by' : 'department_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<record id="hr_attendance_detail_action" model="ir.actions.act_window">
|
||||
<field name="name">出勤详情</field>
|
||||
<field name="res_model">hr.attendance.detail</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">tree,form,search</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="menu_hr_attendance_attendances_view" name="考勤" parent="hr_attendance.menu_hr_attendance_root" sequence="20"/>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="出勤" decoration-danger="abnormal == 1"
|
||||
edit="false" delete="false" create="false"
|
||||
editable="bottom" banner_route="/attendance/banner/route">
|
||||
editable="bottom" banner_route="/attendance/banner/route" limit="20">
|
||||
<field name="employee_id" class="list_current_data"/>
|
||||
<field name="current_data" optional="show" class="list_current_data"/>
|
||||
<field name="check_in" optional="show" widget="time" class="list_current_data"/>
|
||||
@@ -25,7 +25,6 @@
|
||||
<field name="abnormal" optional="show" column_invisible="1"/>
|
||||
<field name="work_time_type" optional="hidden"/>
|
||||
<field name="is_approval" optional="hidden"/>
|
||||
<field name="real_company_id" column_invisible="1"/>
|
||||
<button name="button_controls_wizard" type="object" string="操作" class="oe_highlight" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)"/>
|
||||
<button name="button_correct_wizard" type="object" string="修正" class="btn btn-primary" invisible="not (is_abnormal or is_early_card or is_late_card or absenteeism_card or is_no_card)" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
<button name="button_source" type="object" string="详情" class="oe_highlight" groups="yuthon_hr_attendance.group_he_attendance_sign_manager"/>
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
<attribute name="widget">None</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='check_out']" position="after">
|
||||
<field name="real_company_id" invisible="1"/>
|
||||
<field name="sch_check_out_time"/>
|
||||
<field name="check_noon"/>
|
||||
<field name="sch_check_noon_time"/>
|
||||
|
||||
Reference in New Issue
Block a user