@@ -17,7 +17,7 @@ class YuthonAdjustmentsApproval(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_data = fields.Date(string="值班时间")
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
|
||||
|
||||
@@ -49,4 +49,19 @@ class YuthonDutyArrangement(models.Model):
|
||||
pass
|
||||
|
||||
def bottom_adjustment(self):
|
||||
pass
|
||||
form_id = self.env.ref("yuthon_hr_attendance.view_yuthon_adjustments_approval_form").id
|
||||
start_date = fields.Date.from_string(self.start_time)
|
||||
if start_date.weekday() not in (5, 6):
|
||||
raise UserError("只有在开始日期为周六或周日时才可以调休")
|
||||
else:
|
||||
use_id = self.employee_id.user_id.id
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': '调休申请',
|
||||
'res_model': 'yuthon.adjustments.approval',
|
||||
"views": [[form_id, "form"]],
|
||||
"context": {
|
||||
'default_users_id':use_id,
|
||||
'default_replacement_data':self.start_time
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<field name="related_issues_id" invisible="not is_issues"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="replacement_time"/>
|
||||
<field name="replacement_data"/>
|
||||
<field name="department_id"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from . import attendance_iot_manager_wizard
|
||||
|
||||
from . import yuthon_duty_arrangement_wizard
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
from odoo import api, fields, models, tools
|
||||
from odoo.exceptions import ValidationError
|
||||
|
||||
|
||||
class YuthonDutyArrangementWizard(models.TransientModel):
|
||||
_name = 'yuthon.duty.arrangement.wizard'
|
||||
_description = '自动安排值班弹窗'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user