Skip to Content
Menu
This question has been flagged

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:
            uom_id.append(product.uos_id.id)
        ref_unit =  self.search(cr, uid, [('category_id', '=', product.uom_id.category_id.id), ('uom_type', '=', 'reference')])
        if ref_unit:
            uom_id.append(ref_unit[0])
        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>
           <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>
            </xpath>
Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
8469
1
May 25
994
1
May 25
1020
2
Mar 25
1012
1
Mar 25
1011