Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
1438 Ansichten

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
Verwerfen
Beste Antwort

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

Avatar
Verwerfen
Autor Beste Antwort

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

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
4
Okt. 25
3006
2
Sept. 25
1915
4
Sept. 25
7036
0
Aug. 25
920
4
Mai 25
3794