Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to arrange Radio buttons in vertically

By
nishad
on 5/18/16, 4:14 AM 833 views

I have  around 12 radio button options in my custom form , its bit ugly to scroll and input the values for this options,

how do i arrange the radio buttons horizontally ? Any tips or tricks to achieve this ?

You could either do this with a group which you add colspan and rowspan on or with a simple HTML table, in which you put all the radiobuttons.

Yenthe
on 5/18/16, 5:37 AM
1

Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
Tiny ERP Pvt Ltd
http://www.odoo.com
5975
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.

 

Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 

 

We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :

 

  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 5/18/16, 6:00 AM

Hi Nishad,

You have to manage columns inside group to achieve your goal for manage 12 radio buttons horizontally. For ex.

<group colspan="4" col="24">
<field name="radio_field1" />
<field name="radio_field2" />
<field name="radio_field3" />
<field name="radio_field4" />
<field name="radio_field5" />
<field name="radio_field6" />
<field name="radio_field7" />
<field name="radio_field8" />
<field name="radio_field9" />
<field name="radio_field10" />
<field name="radio_field11" />
<field name="radio_field12" />
</group>

As above  colspan="4" means merge 4 columns, default Odoo seperated all group in 4 coulmns. And col="24" means create 24 columns after merge those 4 columns and all 12 radio button will fit inside it.

It may help a lot.

Update : 
You can manage as like below.

<group colspan="4" col="10">
    <field name="radio_field1" />
</group>
<group colspan="4" col="10">    
    <field name="radio_field2" />
</group>
 
...
...
<group colspan="4" col="10">
<field name="radio_field12" />
</group>

I think you will get radio options as you want.

0
nishad
On 5/18/16, 6:36 AM

Thanks for your comments Emipro Technologies.. You are right ... but the scenario is something different like as follows,

i have a field 

'f1': fields.selection([('1', '1'),('2', '2'),('3','3'),('4','4'),('5','5'),('6','6'),('7','7'),('8','8'),('9','9'),('10','10')], 'Communication Skills'),

similarly 11 more other fields like f2,f3, etc... and in my view.xml am making it like 

<group colspan="4" col="24">
<field name="f1" widget="radio"/>
<field name="f2" widget="radio"/>
.
.
</group>

The above alignment keep individual filelds in horizontal but the options in vertical order ..

So how do i align my selection options in horizontal ? 

Thanks...

Hello Please have a look in update of my answer.

Emipro Technologies Pvt. Ltd.
on 5/18/16, 8:52 AM

Hi , That's still didn't work as i expected ! Basically the issue is my fields are selection fields and i think we cant align selection field entries horizontally.. Am giving widget="radio" for my selection field entries ..

nishad
on 5/19/16, 8:11 AM

can you paste your code or xml and screen of its output ? Will help you more on that.

Emipro Technologies Pvt. Ltd.
on 5/20/16, 5:42 AM

My .py file has fields as follows, 'q1': fields.selection([('1', '1'),('2', '2'),('3','3'),('4','4'),('5','5'),('6','6'),('7','7'),('8','8'),('9','9'),('10','10')], 'Overall Experience'), 'q2': fields.selection([('1', '1'),('2', '2'),('3','3'),('4','4'),('5','5'),('6','6'),('7','7'),('8','8'),('9','9'),('10','10')], 'Communication Skills'), .. .. .xml file has alignment as follows, This will display the field vertically not in horizontal way( I can't attach my image here ...... )

nishad
on 5/22/16, 12:50 AM

.xml file has fields as you suggested

nishad
on 5/22/16, 12:52 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 5/18/16, 4:14 AM
Seen: 833 times
Last updated: 5/19/16, 1:03 AM