Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1463 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
3150
2
sept 25
1985
4
sept 25
7160
0
ago 25
964
4
may 25
3919