[7.0] Merging purchase order will fail when first one has no origin

Bug #1335887 reported by Yannick Vaucher @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP Community Backports (Addons)
New
Undecided
Unassigned

Bug Description

WARNING This affects only OCB

https://code.launchpad.net/~yann-papouin/ocb-addons/7.0-bug-1091268-purchase-merge-no-origin-duplicates/+merge/210169

Introduced a bug:

When first purchase order has no origin, it will raise the following error:

OpenERP Server Error Client Traceback (most recent call last):

    File ".../webclient/addons/web/http.py", line 204, in dispatch
    response["result"] = method(self, **self.params)
    File ".../webclient/addons/web/controllers/main.py", line 1132, in call_button
    action = self._call_kw(req, model, method, args, {})
    File ".../webclient/addons/web/controllers/main.py", line 1120, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
    File ".../webclient/addons/web/session.py", line 42, in proxy
    result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw)
    File ".../webclient/addons/web/session.py", line 30, in proxy_method
    result = self.session.send(self.service_name, method, *args)
    File ".../webclient/addons/web/session.py", line 103, in send
    raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)
    Server Traceback (most recent call last):
    File ".../webclient/addons/web/session.py", line 89, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
    File ".../server/openerp/netsvc.py", line 296, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
    File ".../server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
    File ".../server/openerp/osv/osv.py", line 190, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
    File ".../server/openerp/osv/osv.py", line 132, in wrapper
    return f(self, dbname, *args, **kwargs)
    File ".../server/openerp/osv/osv.py", line 199, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File ".../server/openerp/osv/osv.py", line 187, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
    File ".../addons/purchase/wizard/purchase_order_group.py", line 71, in merge_orders
    allorders = order_obj.do_merge(cr, uid, context.get('active_ids',[]), context)
    File ".../addons/purchase/purchase.py", line 796, in do_merge
    if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin: TypeError: argument of type 'bool' is not iterable

Related branches

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.