diff options
| -rw-r--r-- | indoteknik_custom/models/tukar_guling.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index 2aaadecf..63c8c27e 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -302,12 +302,7 @@ class TukarGuling(models.Model): def create(self, vals): # Generate sequence number if not vals.get('name') or vals['name'] == 'New': - sequence = self.env['ir.sequence'].search([('code', '=', 'tukar.guling')], limit=1) - if sequence: - vals['name'] = sequence.next_by_id() - else: - # Fallback jika sequence belum dibuat - vals['name'] = self.env['ir.sequence'].next_by_code('tukar.guling') or 'PTG-00001' + vals['name'] = self.env['ir.sequence'].next_by_code('tukar.guling') # Auto-fill origin from operations if not vals.get('origin') and vals.get('operations'): @@ -318,7 +313,7 @@ class TukarGuling(models.Model): vals['partner_id'] = picking.partner_id.id res = super(TukarGuling, self).create(vals) - res.message_post(body=_("CCM Created By %s" ) % self.env.user.name) + res.message_post(body=_("CCM Created By %s") % self.env.user.name) return res def copy(self, default=None): |
