stock module: split delivery creates error when invoicing

Bug #333872 reported by Niels Huylebroeck
4
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

The error copy&paste :

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 231, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 74, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 537, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 517, in _execute
    return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/wizard/__init__.py", line 178, in execute
    res = self.execute_cr(cr, uid, data, state, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/wizard/__init__.py", line 83, in execute_cr
    res['action'] = result_def['action'](self, cr, uid, data, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/stock/wizard/wizard_invoice_onshipping.py", line 102, in _create_invoice
    type=type, context= context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/delivery/stock.py", line 48, in action_invoice_create
    context=context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/sale/stock.py", line 124, in action_invoice_create
    context=context)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/stock/stock.py", line 676, in action_invoice_create
    'origin': picking.name + (picking.origin and (':' + picking.origin) or ''),
TypeError: unsupported operand type(s) for +: 'bool' and 'unicode'

Revision history for this message
Niels Huylebroeck (red15) wrote :

It seems the picking.name is empty after running the partial picking wizard and then this error occurs.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

It looks like you have removes the sequence of stock.picking.

Can you please check that?

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

fixed in revision 2234.

Changed in openobject-addons:
status: New → Fix Released
Revision history for this message
Niels Huylebroeck (red15) wrote :

Revision 2234 shows fixes in account.account model nothing to do with stock.

Is it possible you where mistaken about the revision number ?
I need it so I can backport this fix to a released 5.0 version.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :
Revision history for this message
Niels Huylebroeck (red15) wrote :

Excuse me, but this does not fix the problem, the pickings still have no name which is hardly a desired side effect from doing a partial picking. The only "fix" you have applied now is you do a check if the picking.name is filled and replace it with '' if it's not filled. So now if I would generate an invoice from this picking, the invoice has no link to see from which picking it was generated.

My guess is that the problem is in the stock.wizard_partial_picking the moment the picking is split into 2 different pickings. The copy instruction there on line 146 does not seem to initialize the name of the new picking correctly for some reason.

146 new_picking = pick_obj.copy(cr, uid, pick.id,
147 {
148 'name': pool.get('ir.sequence').get(cr, uid, 'stock.picking'),
149 'move_lines' : [],
150 'state':'draft',
151 })

Changed in openobject-addons:
status: Fix Released → In Progress
Changed in openobject-addons:
status: In Progress → Fix Released
Changed in openobject-addons:
status: Fix Released → In Progress
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Guys I think this bug is related to that one I reported recently:
https://bugs.launchpad.net/openobject-addons/+bug/338289
It has been flagged as fixed bug i'm not quite sure it's the case. We might be mistaken somewhere but we had to patch our customer and revert this specif version of code to make it work (at leas in this case).

Hope this helps,

Raphaël Valyi.

Revision history for this message
Niels Huylebroeck (red15) wrote :

Raphael, we should merge all these partial picking bugs together then (mark duplicate) and solve the one remaining bug after verifying the problem is still in trunk.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

fixed in branch5

Changed in openobject-addons:
status: In Progress → Fix Released
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.