Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
1433 Prikazi

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

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

Avatar
Opusti
Avtor Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
4
okt. 25
2973
2
sep. 25
1910
4
sep. 25
7034
0
avg. 25
916
4
maj 25
3784