@@ -17,7 +17,7 @@
|
||||
<field name="name">soong.workflow.record.tree</field>
|
||||
<field name="model">soong.workflow.record</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="WorkFollow Record" action="open_record" type="object" decoration-muted="approve_state == 'end'" decoration-warning="approve_state != 'end'">
|
||||
<tree string="WorkFollow Record" action="open_record" type="object" decoration-muted="approve_state == 'end'" decoration-warning="approve_state != 'end'" create="false">
|
||||
<field name="name"/>
|
||||
<field name="workflow_id" string="审批类型"/>
|
||||
<field name="node_id" string="当前节点"/>
|
||||
|
||||
@@ -56,6 +56,11 @@
|
||||
'wizard/yuthon_duty_summary_wizard_views.xml',
|
||||
# 'wizard/attendance_iot_manager_wizard_views.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
'yuthon_hr_attendance/static/scss/hr_attendance_scss.scss',
|
||||
],
|
||||
},
|
||||
'installable': True,
|
||||
'application': True,
|
||||
'license': 'LGPL-3',
|
||||
|
||||
@@ -18,7 +18,7 @@ class CardApprovals(models.Model):
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
reason_application = fields.Html(string="申请事由")
|
||||
replacement_time = fields.Datetime(string="补卡时间")
|
||||
replacement_time = fields.Selection([('work', '上班卡'), ('quitting', '下班卡'), ('all', '全天卡')], string="补卡")
|
||||
actual_punch = fields.Datetime(string="实际打卡")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class GoApprovals(models.Model):
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
reason_application = fields.Char(string="事由")
|
||||
go_approval_ids = fields.One2many('go.approvals.line', 'go_approval_id', string="外出详情")
|
||||
go_approval_ids = fields.One2many('go.approvals.line', 'go_approval_id', string="外出详情", default=lambda self: self._default_user_lines())
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
|
||||
@@ -37,12 +37,37 @@ class GoApprovals(models.Model):
|
||||
elif self.related_issues_id:
|
||||
raise UserError("已经创建了相关的上会记录,不能取消勾选")
|
||||
|
||||
@api.model
|
||||
def _default_user_lines(self):
|
||||
return [(0, 0, {'users_id': self.env.user.id})]
|
||||
|
||||
|
||||
class GoApprovalsLine(models.Model):
|
||||
_name = 'go.approvals.line'
|
||||
_description = "外出人明细"
|
||||
|
||||
go_approval_id = fields.Many2one('go.approval', string="关联外出申请")
|
||||
overtime_people = fields.Many2one('hr.employee', string="外出人")
|
||||
users_id = fields.Many2one('res.users', string="外出人")
|
||||
applicants_unit = fields.Selection([('hour', '小时'), ('day', '天')], string="申请单位")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
date_start = fields.Datetime(string="开始时间")
|
||||
date_end = fields.Datetime(string="结束时间")
|
||||
date_end = fields.Datetime(string="结束时间")
|
||||
|
||||
@api.onchange('date_start', 'date_end')
|
||||
def _onchange_weekend(self):
|
||||
for record in self:
|
||||
if record.applicants_unit == 'day' and record.date_start and record.date_end:
|
||||
start_date = record.date_start.date()
|
||||
end_date = record.date_end.date()
|
||||
current_date = start_date
|
||||
while current_date <= end_date:
|
||||
if current_date.weekday() in (5, 6):
|
||||
raise UserError("申请时间范围内包含周六或周日,请重新选择日期")
|
||||
current_date += timedelta(days=1)
|
||||
|
||||
@api.onchange('date_start', 'date_end')
|
||||
def _onchange_dates(self):
|
||||
for record in self:
|
||||
if record.date_start and record.date_end:
|
||||
if record.date_start >= record.date_end:
|
||||
raise UserError("开始时间必须小于结束时间!")
|
||||
@@ -22,6 +22,8 @@ class HrAttendance(models.Model):
|
||||
out_card_location = fields.Char(string="外出打卡地点")
|
||||
work_hours = fields.Float(string="工作时长")
|
||||
current_data = fields.Date(string='打卡日期', tracking=True)
|
||||
weed = fields.Char(string='星期', compute='_compute_weed')
|
||||
|
||||
|
||||
def hr_attendance_time(self):
|
||||
today = fields.Date.today()
|
||||
@@ -103,4 +105,14 @@ class HrAttendance(models.Model):
|
||||
"context": {
|
||||
'default_users_id': self.employee_id.user_id.id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@api.depends('check_in')
|
||||
def _compute_weed(self):
|
||||
for record in self:
|
||||
if record.check_in:
|
||||
weekday = record.check_in.weekday()
|
||||
weekdays_cn = ["星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"]
|
||||
record.weed = weekdays_cn[weekday]
|
||||
else:
|
||||
record.weed = False
|
||||
@@ -21,6 +21,7 @@ class OvertimeApprovals(models.Model):
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
details = fields.Text(string="加班说明")
|
||||
related_issues_id = fields.Many2one('issue.library', string="关联议题")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
@api.onchange('is_issues')
|
||||
def _onchange_is_issues(self):
|
||||
@@ -102,7 +103,6 @@ class OvertimeUserLine(models.Model):
|
||||
users_id = fields.Many2one('res.users', string="加班人员")
|
||||
department_id = fields.Many2one('hr.department', string="部门")
|
||||
overtime_hours = fields.Float(string="本月加班时长")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
start_time = fields.Datetime(string="开始时间")
|
||||
end_time = fields.Datetime(string="结束时间")
|
||||
hours = fields.Float(string="加班时长", compute="_compute_hours")
|
||||
|
||||
@@ -15,12 +15,9 @@ class RemoveHolidayApprovals(models.Model):
|
||||
date = fields.Datetime(string="日期", default=fields.Datetime.now)
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
partner_id = fields.Many2one('res.partner', string="来文单位")
|
||||
statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态",
|
||||
default='drft')
|
||||
entry_time = fields.Datetime(string="入职时间")
|
||||
type_remove_holiday = fields.Char(string="销假类型")
|
||||
user_sex = fields.Selection([('girl', '女'), ('boy', '男')], string="性别")
|
||||
role_id = fields.Many2one('yuthon.user.role', string="岗位")
|
||||
date_start = fields.Datetime(string="开始时间", default=fields.Datetime.now)
|
||||
date_end = fields.Datetime(string="结束时间")
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
.list_width{
|
||||
width: 30px;
|
||||
max-width: 30px;
|
||||
}
|
||||
.list_ids_width{
|
||||
width: 30px !important;
|
||||
max-width: 30px !important;
|
||||
}
|
||||
@@ -18,6 +18,11 @@
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name" required="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<group string="个人信息" col="3">
|
||||
<group>
|
||||
<field name="users_id"/>
|
||||
@@ -35,7 +40,6 @@
|
||||
</group>
|
||||
<group string="审批事项">
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="reason_application"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
@@ -45,7 +49,6 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="approval_request_card" model="ir.actions.act_window">
|
||||
<field name="name">补卡</field>
|
||||
<field name="res_model">card.approval</field>
|
||||
|
||||
@@ -46,10 +46,11 @@
|
||||
<field name="go_approval_ids" string="">
|
||||
<tree editable="bottom">
|
||||
<field name="go_approval_id" column_invisible="1"/>
|
||||
<field name="overtime_people"/>
|
||||
<field name="users_id"/>
|
||||
<field name="applicants_unit"/>
|
||||
<field name="date_start" required="1"/>
|
||||
<field name="date_end" required="1"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
|
||||
@@ -9,16 +9,17 @@
|
||||
decoration-danger="is_abnormal">
|
||||
<field name="employee_id" widget="many2one_avatar_user"/>
|
||||
<!-- <field name="company_id" optional="show"/>-->
|
||||
<!-- <field name="current_data" optional="show"/>-->
|
||||
<field name="is_clock_card" optional="show"/>
|
||||
<field name="is_no_card" optional="show"/>
|
||||
<field name="is_early_card" optional="show"/>
|
||||
<field name="is_late_card" optional="show"/>
|
||||
<field name="is_abnormal" optional="show"/>
|
||||
<field name="is_no_card" optional="show" class="list_width"/>
|
||||
<field name="is_early_card" optional="show" class="list_width"/>
|
||||
<field name="is_late_card" optional="show" class="list_width"/>
|
||||
<field name="is_abnormal" optional="show" class="list_width"/>
|
||||
<field name="weed" optional="show"/>
|
||||
<field name="work_time_type" optional="hidden"/>
|
||||
<!-- <field name="current_data"/>-->
|
||||
<field name="check_in" optional="show"/>
|
||||
<field name="check_in" optional="show" widget="time"/>
|
||||
<!-- <field name="on_card_location" optional="show"/>-->
|
||||
<field name="check_out" optional="show"/>
|
||||
<field name="check_out" optional="show" widget="time"/>
|
||||
<button name="button_leave" type="object" string="请假" class="oe_highlight"/>
|
||||
<button name="button_compensatory_leave" type="object" string="调休" class="oe_highlight"/>
|
||||
<button name="hr_attendance_time" type="object" string="cs"/>
|
||||
|
||||
@@ -34,10 +34,11 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id"/>
|
||||
<field name="reason_application"/>
|
||||
<field name="users_id"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="users_id"/>
|
||||
<field name="reason_application"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="details"/>
|
||||
<field name="is_issues"/>
|
||||
<field name="related_issues_id" invisible="not is_issues"/>
|
||||
@@ -53,7 +54,6 @@
|
||||
<field name="start_time"/>
|
||||
<field name="end_time"/>
|
||||
<field name="hours"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<field name="overtime_hours"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="date"/>
|
||||
<field name="statu"/>
|
||||
</tree>
|
||||
@@ -22,28 +21,25 @@
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
<sheet>
|
||||
<group string="审批事由">
|
||||
<field name="name" required="1"/>
|
||||
<field name="reason_application"/>
|
||||
</group>
|
||||
<group string="审批人信息">
|
||||
<group>
|
||||
<field name="users_id"/>
|
||||
<field name="department_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="entry_time"/>
|
||||
<field name="type_remove_holiday"/>
|
||||
<field name="user_sex"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date_start"/>
|
||||
<field name="date_end"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="code"/>
|
||||
<field name="type_remove_holiday"/>
|
||||
<field name="is_issues"/>
|
||||
<field name="related_issues_id" invisible="not is_issues"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="审批事由">
|
||||
<field name="name" required="1"/>
|
||||
<field name="reason_application"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
@@ -60,7 +56,6 @@
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="approval_request_remove_holiday" model="ir.actions.act_window">
|
||||
<field name="name">销假</field>
|
||||
<field name="res_model">remove.holiday.approval</field>
|
||||
|
||||
@@ -4,7 +4,10 @@
|
||||
<field name="name">yuthon.notice.tree</field>
|
||||
<field name="model">yuthon.notice</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="公告管理">
|
||||
<tree string="公告管理"
|
||||
decoration-success="notice_state == 'yes' "
|
||||
decoration-info="notice_state == 'no' "
|
||||
decoration-muted="notice_state == 'stop'">
|
||||
<field name="users_id" string="发布人"/>
|
||||
<field name="notice_type_id" string="类型"/>
|
||||
<field name="name" required="1"/>
|
||||
@@ -13,6 +16,7 @@
|
||||
<field name="create_date"/>
|
||||
<field name="start_date"/>
|
||||
<field name="end_date"/>
|
||||
<field name="notice_state"/>
|
||||
<button name="on_sequence" string="置顶" invisible="sequence != 0" type="object" class="btn-primary"/>
|
||||
<button name="no_sequence" string="取消置顶" invisible="sequence != 1" type="object"
|
||||
class="btn-primary"/>
|
||||
@@ -149,7 +153,6 @@
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_notice.view_yuthon_notice_tree2')}),
|
||||
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_notice.view_yuthon_notice_form2')})]"/>
|
||||
</record>
|
||||
|
||||
<record id="approval_notice_action3" model="ir.actions.act_window">
|
||||
<field name="name">天河投资通知公告</field>
|
||||
<field name="res_model">yuthon.notice</field>
|
||||
|
||||
Reference in New Issue
Block a user