Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
1447 Visninger

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
Kassér
Bedste svar

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

Avatar
Kassér
Forfatter Bedste svar

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

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
4
okt. 25
3056
2
sep. 25
1931
4
sep. 25
7061
0
aug. 25
927
4
maj 25
3830