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

using Odoo 13 CE. I have managed to add a model as well as create custom many2many field which shows up (& works) in the sales order.

I need to have a multi-select checkboxes on the "extra info" option of the website checkout. I have previously managed to get custom text as well as selection fields working, however the page wont go to the next step if i add a checkbox field, kindly assist with the code. Unsure what options need to be used for a many2many field checkboxes.


Currently using:

<div class="form-group row form-field o_website_form_custom">
                                            <div class="col-lg-3 col-md-4 text-md-right">
                                                <label class="col-form-label" for="x_binding">Binding</label>
                                            </div> 
                                            <div class="col-lg-9 col-md-8">
                                              <div class="col-lg-9 col-md-8">                    
                                                  <input type="checkbox" id="Center Pinning" name="x_binding" class="custom-control-input"/>
                                                  <label for="Center Pinning" class="custom-control-label">Center Pinning</label>                          
                                             </div>
                                             <div class="col-lg-9 col-md-8">                    
                                                  <input type="checkbox" id="Perfect Binding" name="x_binding" class="custom-control-input"/>
                                                  <label for="Perfect Binding" class="custom-control-label">Perfect Binding</label>                          
                                             </div> 
                                             <div class="col-lg-9 col-md-8">                    
                                                  <input type="checkbox" id="Section Sewing" name="x_binding" class="custom-control-input"/>
                                                  <label for="Section Sewing" class="custom-control-label">Section Sewing</label>                          
                                             </div> 
                                             </div>
                                      </div>           

形象
丢弃
编写者

Update:

After some trial & error, i tried a new syntax , however the only way to move ahead in the form is to remove the "name" in the input without which, the data is not being saved in the backend. Once i put the "name" back it will no longer move to the next page:

<div class="custom-control custom-checkbox">

<input type="checkbox" id="#120" class="custom-control-input" name="x_screening1" value="#120"/>

<label for="#120" class="custom-control-label" name="x_screening1">#120</label>

</div>

最佳答案

<input type="checkbox" id="#120" class="custom-control-input" name="checkbox_1" value="#120"/>
<input type="checkbox" id="#120" class="custom-control-input" name="checkbox_2" value="#120"/>

You can add multiple selection in website and allow to select more than one checkbox true/false.

形象
丢弃
相关帖文 回复 查看 活动
1
6月 22
5583
0
5月 22
2160
1
5月 19
9468
2
9月 17
9663
1
3月 15
11372