summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/gudang_service.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/indoteknik_custom/models/gudang_service.py b/indoteknik_custom/models/gudang_service.py
index 93f8805a..0cdee5af 100644
--- a/indoteknik_custom/models/gudang_service.py
+++ b/indoteknik_custom/models/gudang_service.py
@@ -19,7 +19,7 @@ class GudangService(models.Model):
done_date = fields.Datetime(string='Date Done', copy=False, tracking=True)
gudang_service_lines = fields.One2many('gudang.service.line', 'gudang_service_id', string='Gudang Service Lines')
remaining_date = fields.Char('Remaining Date', compute='_compute_remaining_date')
- state = fields.Selection([('draft', 'Draft'), ('onprogress', 'On Progress'),('done', 'Done'), ('cancel', 'Cancel')], default='draft', tracking=True)
+ state = fields.Selection([('draft', 'Backlog'), ('onprogress', 'On Progress'),('done', 'Done'), ('cancel', 'Cancel')], default='draft', tracking=True)
cancel_reason = fields.Text('Cancel Reason', tracking=True)
# @api.onchange('picking_id')
@@ -113,7 +113,6 @@ class GudangService(models.Model):
for rec in self:
rec.state = 'onprogress'
rec.date = fields.Datetime.now()
- self._send_logistic_notification()
def action_done(self):
for rec in self:
@@ -130,6 +129,7 @@ class GudangService(models.Model):
def action_draft(self):
"""Reset to draft state"""
for rec in self:
+ rec.cancel_reason = False
if rec.state == 'cancel':
rec.write({'state': 'draft'})
else:
@@ -148,12 +148,11 @@ class GudangService(models.Model):
raise UserError("Cancel Reason must be filled")
rec.state = 'cancel'
- # def write(vals, self):
- # self.send_odoo_notification()
- # return super(GudangService, self).write(vals)
@api.model
def create(self, vals):
+ # Send notification
+ self._send_logistic_notification()
if not vals.get('name') or vals['name'] == 'New':
vals['name'] = self.env['ir.sequence'].next_by_code('gudang.service')