Como hacer un autofocus en un campo de un tree en odoo 11?

187 views
Skip to first unread message

carlo...@gmail.com

unread,
Jun 15, 2018, 4:57:52 PM6/15/18
to openerp-chile
Her intentado hacer un autofocus y habilitar el campo de lot_name en un tree y no lo consigo.

Odoo 11 en Linux.

<tree editable="bottom" create="0" decoration-muted="state == 'done' and is_locked == True" decoration-success="product_uom_qty==qty_done" decoration-danger="qty_done &gt; product_uom_qty and state != 'done'">
                    <field name="picking_id" invisible="1"/>
                    <field name="product_id" invisible="1"/>
                    <field name="in_entire_package" invisible="1"/>
                    <field name="location_id" attrs="{'readonly': [('in_entire_package', '=', True)]}" invisible="not context.get('show_source_location')" domain="[('id', 'child_of', parent.location_id)]" groups="stock.group_stock_multi_locations"/>
                    <field name="location_dest_id" attrs="{'readonly': [('in_entire_package', '=', True)]}" invisible="not context.get('show_destination_location')" domain="[('id', 'child_of', parent.location_dest_id)]" groups="stock.group_stock_multi_locations"/>
                    <field name="lot_id" attrs="{'readonly': [('in_entire_package', '=', True)]}" invisible="not context.get('show_lots_m2o')" domain="[('product_id', '=', parent.product_id)]" groups="stock.group_production_lot" context="{'default_product_id': parent.product_id, 'active_picking_id': picking_id}"/>
                    <field name="lot_name" attrs="{'readonly': [('in_entire_package', '=', True)]}" invisible="not context.get('show_lots_text')" groups="stock.group_production_lot"/>
                    <field name="package_id" attrs="{'readonly': [('in_entire_package', '=', True)]}" invisible="not context.get('show_package')" groups="stock.group_tracking_lot" domain="[('location_id', '=', location_id)]"/>
                    <field name="result_package_id" attrs="{'readonly': [('in_entire_package', '=', True)]}" groups="stock.group_tracking_lot" domain="['|', '|', ('location_id', '=', False), ('location_id', '=', location_dest_id), ('id', '=', package_id)]"/>
                    <field name="owner_id" groups="stock.group_tracking_owner"/>
                    <field name="is_initial_demand_editable" invisible="1"/>
                    <field name="product_uom_qty" invisible="not context.get('show_reserved_quantity')" readonly="1"/>
                    <field name="state" invisible="1"/>
                    <field name="is_locked" invisible="1"/>
                    <field name="qty_done" attrs="{'readonly': ['|','|', ('is_initial_demand_editable', '=', True), '&amp;', ('state', '=', 'done'), ('is_locked', '=', True), ('in_entire_package', '=', True)]}"/>
                    <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" attrs="{'readonly': ['|', ('product_uom_qty', '!=', 0.0), ('in_entire_package', '=', True)]}" string="Unit of Measure" groups="product.group_uom"/>
                </tree>

He intentado cambiarlo en una vista heredada,  y  nada.


            <field name="lot_name" position="attributes">                      
                          
                              <attribute name="default_focus">1</attribute>
            </field>


No existe otro default_focus y no funciona, 

ya probe con autofocus=True pero con este da error.

Reply all
Reply to author
Forward
0 new messages