添加功能
This commit is contained in:
@@ -65,8 +65,8 @@ class YuthonWillTask(models.Model):
|
||||
('22', '22:00'), ('22.25', '22:15'), ('22.5', '22:30'), ('22.75', '22:45'),
|
||||
('23', '23:00'), ('23.25', '23:15'), ('23.5', '23:30'), ('23.75', '23:45')], string='结束时间', default='18')
|
||||
|
||||
priority = fields.Selection([('general', '不紧急不重要'), ('important', '重要不紧急'),
|
||||
('urgent', '紧急不重要'), ('very_urgent', '重要且紧急')], string='优先级', default='general')
|
||||
priority = fields.Selection([('important', '重要不紧急'),
|
||||
('urgent', '紧急不重要'), ('very_urgent', '重要且紧急')], string='优先级')
|
||||
code = fields.Char(string="任务编号", default=lambda self: self.env['ir.sequence'].next_by_code('task_code'))
|
||||
user_id = fields.Many2one('res.users', string="创建人", default=lambda self: self.env.user)
|
||||
company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company)
|
||||
@@ -141,7 +141,7 @@ class YuthonWillTask(models.Model):
|
||||
from_time = hour_mapping.get(record.request_hour_from, "")
|
||||
to_time = hour_mapping.get(record.request_hour_to, "")
|
||||
if date_str and from_time and to_time:
|
||||
record.task_time = f"{date_str} ({from_time}--{to_time})"
|
||||
record.task_time = f"{date_str} {from_time}"
|
||||
else:
|
||||
record.task_time = ""
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
decoration-muted = "task_state == 'cancel'"
|
||||
decoration-danger="priority == 'very_urgent'"
|
||||
decoration-info="priority == 'urgent'"
|
||||
decoration-primary="priority == 'general'"
|
||||
decoration-success="priority == 'important'">
|
||||
<field name='start_date' column_invisible="1"/>
|
||||
<field name='task_time' />
|
||||
@@ -49,7 +48,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="日程">
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="不紧急不重要" bg_color="text-bg-secondary" invisible="priority != 'general'"/>
|
||||
<widget name="web_ribbon" title="重要不紧急" bg_color="text-bg-success" invisible="priority != 'important'"/>
|
||||
<widget name="web_ribbon" title="紧急不重要" bg_color="text-bg-warning" invisible="priority != 'urgent'"/>
|
||||
<widget name="web_ribbon" title="重要且紧急" bg_color="text-bg-danger" invisible="priority != 'very_urgent'"/>
|
||||
@@ -120,7 +118,6 @@
|
||||
decoration-muted = "task_state == 'cancel'"
|
||||
decoration-danger="priority == 'very_urgent'"
|
||||
decoration-info="priority == 'urgent'"
|
||||
decoration-primary="priority == 'general'"
|
||||
decoration-success="priority == 'important'" create="false" edit="false" js_class="custom_task_tree_button">
|
||||
<field name='start_date' column_invisible="1"/>
|
||||
<field name='task_time' />
|
||||
@@ -148,8 +145,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="日程" create="false">
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="不紧急不重要" bg_color="text-bg-secondary"
|
||||
invisible="priority != 'general'"/>
|
||||
<widget name="web_ribbon" title="重要不紧急" bg_color="text-bg-success"
|
||||
invisible="priority != 'important'"/>
|
||||
<widget name="web_ribbon" title="紧急不重要" bg_color="text-bg-warning"
|
||||
|
||||
Reference in New Issue
Block a user