تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1437 أدوات العرض

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
أكتوبر 25
3006
2
سبتمبر 25
1915
4
سبتمبر 25
7036
0
أغسطس 25
919
4
مايو 25
3794