Skip to Content
Menu
This question has been flagged
4250 Views

Hello, I try to use Javascript on a custom module view. But, that did'nt work. I alway have the same error:

Uncaught TypeError: object is not a function

<record model="ir.ui.view" id="sale_order_line_type_price">
        <field name="name">sale.order.line.type.price</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">
           <xpath expr="//field[@name='order_line']/tree//field[@name='price_unit']" position="replace">
           <script>
                console.log('test');
           </script>
                    <field name="price_unit"/>
            </xpath>
        </field>
    </record>

I, also, try with an extern js file but same result.

Avatar
Discard