Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
1445 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Penulis Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
4
Okt 25
3044
2
Sep 25
1926
4
Sep 25
7046
0
Agu 25
923
4
Mei 25
3812