Skip to Content
Menú
This question has been flagged
2 Respostes
1460 Vistes

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
Best Answer

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

Avatar
Descartar
Autor Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
4
d’oct. 25
3106
2
de set. 25
1954
4
de set. 25
7117
0
d’ag. 25
947
4
de maig 25
3874