Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
13732 มุมมอง

I'm a beginner, about Odoo 8.

Is there a way to give boolean checkbox in the list view as yes or no.
Boolean To String.

true, yes, false, no = _(u"true"), _(u"yes"), _(u"false"), _(u"no")

This does not work properly. Is there a solution on a py basis?

<field name="Name2" attrs="{'invisible':[('Name1','=',False)]}"/>

'Name1': fields.boolean('Name1', readonly=True, states={'Draft': [('readonly', False)]}),

  <tree string='List'>
                        <field name="Name1"/> Output as Yes or No
                    </tree>


Maybe with: true, yes, false, no = _(u"true"), _(u"yes"), _(u"false"), _(u"no")

อวตาร
ละทิ้ง

Why don't you try selection field instead of boolean.

คำตอบที่ดีที่สุด

Hai Aleks..!
you can achieve this by selection field. 

field_name = fields.Selection([('yes', 'Yes'), ('no', 'No')], string='Yes/No')


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks, very good answer.   Odoo 8

'field_name' : fields.selection([('yes', 'Yes'), ('no', 'No')], string='Yes/No'),
<field name="field_name" widget="radio"/>

 or

'field_name' : fields.selection([('yes', 'Yes')], string='Yes'),

<field name="field_name" widget="Radio"/>


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 20
5214
0
เม.ย. 15
3107
4
ส.ค. 23
15157
0
มี.ค. 25
2853
2
เม.ย. 23
4430