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 do I change the Sale order line product dropdown width?

By
Ruben Fortunato
on 10/4/16, 2:20 PM 213 views

I'm trying to change the width of the product dropdown list that appears when when creating a sale order line, but I cannot find how to target element for css. Any clue? Thanks

0
shameem@aχoncoms
On 10/5/16, 1:11 AM

Hi Ruben, try this

Create an additional field near the product to hold it's space.

Add class to the Many2one field and additional field

Then write style to adjust the width and to hide additional field


Example

<page string="Order Lines">

    <style>
         //Adjust width
        span.oe_form_field.oe_form_field_many2one.oe_form_field_with_button.Your-Custom-Class.oe_form_required{min-width:129px;z-index:1}
         // hide additional field
        .oe_form_field.oe_form_field_text.to-be-hidden.oe_form_required{visibility:hidden}
    </style>

        <field name="order_line" mode="tree,kanban" attrs="{'readonly': [('state', 'in', ('done','cancel'))]}">
            <form string="Sales Order Lines">
                 .......
            </form>
              <tree string="Sales Order Lines" editable="bottom" decoration-info="invoice_status=='to invoice'">
                <field name="sequence" widget="handle"/>
<!-----------------------------------------Both fields---------------------------------------------->
                <field name="product_id" class="Your-Custom-Class" attrs="{'readonly': ['|', ('qty_invoiced', '&gt;', 0), ('procurement_ids', '!=', [])]}" context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}" />
                <field name="name" string="" class="to-be-hidden"/>
<!------------------------------------------------------------------------------------------>
                     ......
          </field>
</page>

 

 




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

1 follower(s)

Stats

Asked: 10/4/16, 2:20 PM
Seen: 213 times
Last updated: 10/6/16, 3:49 PM