跳至内容
菜单
此问题已终结
2 回复
1434 查看

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')
形象
丢弃
最佳答案

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

形象
丢弃
编写者 最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
4
10月 25
3004
2
9月 25
1913
4
9月 25
7036
0
8月 25
918
4
5月 25
3788