Help

5

Selection in Template. How to show all selection field values in website.

Avatar
Annadurai

Below code only shows what I have selected in the backend. It doesn't show other values. I know below code only show current value. But I want to get all the selected field values. Any suggestions?

<label class="control-label" for="web_priority">Priority</label>

              <select name="web_priority" class="form-control">

        <t t-foreach="order or []" t-as="a">

            <option t-att-value="web_priority"  selected="True"> <t t-esc="order.web_priority" />

            </option>

        </t>

    </select>

2 Comments
Avatar
Discard
Avatar
Niyas Raphy
-
Avatar
Annadurai
-

Hello Niyas, Checkout that link, Me too answered that. What I am asking is How to show selection field values Like Many2one.

1 Answer
1
Best Answer


Use <select> to show the Selection field in website form.

your_field = fields.Selection([('10', '10'), ('20', '20'), ('30', '30'), ('40', '40')])
 
    .........
        <select>
            <option value="10">10</option>
            <option value="20">20</option>
            <option value="30">30</option>
            <option value="40">40/option>

                 .......
        </select>         
    .........
 

 


1 Comment
Avatar
Discard
Avatar
Annadurai
-

What I am asking is How to show selection field values Like Many2one. Just like list of countries in website template. Countries are many2one but my fields are defined in fields.Selection.