Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1459 Vistas

I tried to set a default status value to "Draft" when creating a new record, but the status is always blank. If I set the status manually, it worked. Here is the my command. Am I missing something?

class custom_purchase(models.Model):
_name = 'custom.purchase'

name = fields.Char(string="Name")
tanggal = fields.Date(string="Tanggal")
status = fields.Selection([('draft','Draft'),('approve','Approve'),('done','Done')], default='draft')
Avatar
Descartar
Mejor respuesta

Try upgrade restart server and update module, perhaps the default has not been updated yet

Avatar
Descartar
Autor Mejor respuesta

Restarted Odoo service, ran Update App List, ran Apply Upgrade, upgraded the module, and it worked! Thanks!

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
4
oct 25
3101
2
sept 25
1953
4
sept 25
7114
0
ago 25
945
4
may 25
3871