Skip to Content
मेन्यू
This question has been flagged
2 Replies
1446 Views

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

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

Avatar
Discard
Author Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
4
अक्तू॰ 25
3051
2
सित॰ 25
1929
4
सित॰ 25
7059
0
अग॰ 25
926
4
मई 25
3823