Odoo Help


Why Filter causes Uncaught Error: Expected ")", got "(string)" error?

E.R. Spada II
on 3/1/14, 5:53 PM 1,889 views

I have a filter on the sales_order_line so it only shows uom, po_uom, uos, so users do not select a uom that we do not sell. After updating Openerp server/web in Jan. This has always worked in the past.

When the use edits the existing quotation on the sales order line, when you click on the UOM bang: Uncaught Error: Expected ")", got "(string)" web/static/lib/py.js/lib/py.js:361

Not sure why this stopped working. Here is the py for the function and the XML:

class product_uom(osv.Model): _inherit = "product.uom"

def name_search(self, cr, uid, name, args=None, operator='ilike', context=None, limit=100):
    if context.get('product_id'):
        product = self.pool.get('product.product').browse(cr, uid, context['product_id'])
        uom_id = [product.uom_id.id, product.uom_po_id.id]
        if product.uos_id:
        ref_unit =  self.search(cr, uid, [('category_id', '=', product.uom_id.category_id.id), ('uom_type', '=', 'reference')])
        if ref_unit:
        args.append(('id', 'in', uom_id))
        print args
    return super(product_uom, self).name_search(cr, uid, name, args=args, operator=operator, context=context, limit=limit)

<xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/div[@groups='product.group_uos']/field[@name='product_uos']" position="attributes"> <attribute name="domain" >['|','|',('id','=",product.uom_id),(" id','=",product.uos_id" ),('id','=",product.uom_po_id)]</attribute> <attribute name="context">{" product_id':product_id}<="" attribute=""> </xpath> <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='product_uos']" position="attributes"> <attribute name="domain" >['|','|',('id','=",product.uom_id),(" id','=",product.uos_id" ),('id','=",product.uom_po_id)]</attribute> <attribute name="context">{" product_id':product_id}<="" attribute=""> </xpath>

           <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/form[@string='Sales Order Lines']/group/group/div/field[@name='product_uom']" position="attributes">
                <attribute name="domain" >['|','|',('id','=',product.uom_id),('id','=',product.uos_id'),('id','=',product.uom_po_id)]</attribute>
                <attribute name="context">{'product_id':product_id}</attribute>
           <xpath expr="//page[@string='Order Lines']/field[@name='order_line']/tree[@string='Sales Order Lines']/field[@name='product_uom']" position="attributes">
                <attribute name="domain" >['|','|',('id','=',product.uom_id),('id','=',product.uos_id'),('id','=',product.uom_po_id)]</attribute>
                <attribute name="context">{'product_id':product_id}</attribute>

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 platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 3/1/14, 5:53 PM
Seen: 1889 times
Last updated: 3/16/15, 8:10 AM