work flow schedule
This commit is contained in:
@@ -11,8 +11,14 @@ class AcademySchedule(models.Model):
|
||||
date = fields.Datetime(string='Ngày và giờ diễn ra buổi học', required=True)
|
||||
duration = fields.Float(string='Thời lượng buổi học (tính theo giờ)', required=True)
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('confirmed', 'Confirmed'),
|
||||
('done', 'Done')
|
||||
('draft', 'Mới đặt lịch'),
|
||||
('confirmed', 'Xác nhận'),
|
||||
('cancel', 'Đã hủy')
|
||||
], string='Trạng thái', default='draft', required=True)
|
||||
|
||||
def action_confirm(self):
|
||||
self.state = 'confirmed'
|
||||
|
||||
def action_cancel(self):
|
||||
self.state = 'cancel'
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="">
|
||||
<header>
|
||||
<button string="Xác nhận" name="action_confirm" type="object"
|
||||
class="oe_highlight" invisible="state != 'draft'" />
|
||||
<button string="Hủy" name="action_cancel" type="object"
|
||||
class="" invisible="state != 'draft'" />
|
||||
<field name="state" widget="statusbar" />
|
||||
</header>
|
||||
<sheet>
|
||||
|
||||
Reference in New Issue
Block a user