pengyuthon wechat
This commit is contained in:
@@ -20,7 +20,7 @@ class YuthonNotice(models.Model):
|
||||
start_date = fields.Date(string="生效日期", default=fields.Date.today())
|
||||
end_date = fields.Date(string="终止日期")
|
||||
sequence = fields.Integer(string="顺序", default=1, compute='_compute_sequence')
|
||||
employee_ids = fields.Many2many('hr.employee', string="人员范围")
|
||||
employee_ids = fields.Many2many('hr.employee', string="人员范围", default=lambda self: self.env.user.employee_id)
|
||||
notice_state = fields.Selection([('no', '未发布'), ('yes', '已发布'), ('stop', '已终止')], default='no',
|
||||
string="公告状态")
|
||||
notice_documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
|
||||
@@ -21,6 +21,7 @@ class YuthonWillTask(models.Model):
|
||||
start_time = fields.Datetime(string='开始时间', default=fields.Date.today())
|
||||
end_time = fields.Datetime(string='结束时间', default=lambda self: datetime.combine(datetime.now().date(), time(11, 0, 0)))
|
||||
weed = fields.Char(string='星期', compute='_compute_weed')
|
||||
|
||||
def will_task_time(self):
|
||||
tasks = self.env['yuthon.will.task'].search([])
|
||||
for task in tasks:
|
||||
@@ -29,7 +30,7 @@ class YuthonWillTask(models.Model):
|
||||
duration = self._compute_duration(task_time)
|
||||
if time_difference <= duration and time_difference >= timedelta(seconds=0):
|
||||
task.add_comment()
|
||||
break #
|
||||
break
|
||||
|
||||
def _compute_duration(self, task_time):
|
||||
if task_time.task_unit == 'min':
|
||||
|
||||
Reference in New Issue
Block a user