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

hi all,

in below code i want to have another field " active " with <option t-esc="zone.name" how it can be done with its Display value  like:  value stored in db is " active " the display value is " Active " when user click in it to select a Zone, it should display zone + active as below:

ZoneNameA....[ Active ]

ZoneNameB....[ InActive ]

etc.

                <div class="form-group field-zone_id">
                    <label for="zone_id" class="control-label">Your Zone</label>
                    <select name="zone_id" class="form-control link-style">
                        <t t-foreach="zone_rec" t-as="zone">
                            <option t-esc="zone.name" t-att-value="zone.id"/>
                        </t>
                    </select>
                </div>

regards

形象
丢弃
编写者 最佳答案

it has been done, modified code is here ( refer to my question above for the line modified )

                <div class="form-group field-zone_id">

                    <label for="zone_id" class="control-label">Your Zone</label>

                    <select name="zone_id" class="form-control link-style">

                        <t t-foreach="zone_rec" t-as="zone">

                            <option t-esc="zone.name+'--'+zone.zone_status.title()" t-att-value="zone.id"/>

                        </t>

                    </select>

                </div>


Don't know why I it is not showing code or quote for code i pasted here...

形象
丢弃
相关帖文 回复 查看 活动
1
2月 21
2543
1
2月 25
3651
2
4月 23
2871
2
2月 25
40652
2
11月 22
2916