[7.0/trunk] Purchase Requisition : Error while running procurement.

Bug #1130656 reported by DJ Patel (OpenERP)
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP R&D Addons Team 2

Bug Description

Steps to reproduce the issue:

1. Create a new database without demo data.
2. Install purchase_requisition.
3. Create a new product with following configuration:
 Product Type : Stockable Product
 Procurement Method : Make to Stock
 Supply Method : Buy

4. Tick the 'Purchase Requisition' on product.

5. Now from product, clicked on 'Request Procurement' button to create the procurement.

Run the procurement. It gives the traceback as follow:

Traceback (most recent call last):
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/netsvc.py", line 236, in dispatch_rpc
    result = dispatch(method, params)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/service/model.py", line 27, in dispatch
    res = fn(db, uid, *params)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/service/model.py", line 100, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/service/model.py", line 176, in exec_workflow
    res = exec_workflow_cr(cr, uid, obj, signal, *args)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/service/model.py", line 169, in exec_workflow_cr
    return object.signal_workflow(cr, uid, [res_id], signal)[res_id]
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/osv/orm.py", line 3939, in signal_workflow
    result[res_id] = workflow.trg_validate(uid, self._name, res_id, signal, cr)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/__init__.py", line 106, in trg_validate
    res2 = instance.validate(cr, id, ident, signal)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/instance.py", line 43, in validate
    workitem.process(cr, witem, ident, signal, force_running, stack=stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 60, in process
    ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 175, in _split_test
    _join_test(cr, t[0], t[1], ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 183, in _join_test
    create(cr,[activity], inst_id, ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 40, in create
    process(cr, res, ident, stack=stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 52, in process
    result = _execute(cr, workitem, activity, ident, stack)
  File "/home/mdi/workspace/openerp/rdtools/server/trunk/openerp/workflow/workitem.py", line 133, in _execute
    id_new = cr.fetchone()[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

Thanks,
Divyesh

Tags: purchase

Related branches

affects: openobject-server → openobject-addons
Revision history for this message
DJ Patel (OpenERP) (mdi-openerp) wrote :

An error is due to the procurement workflow defined in purchase module. In procurement workflow there is a subflow to purchase order.

The action defined in subflow must return the ID of the concerned resource by the subflow ! If the action returns False, the workitem disappears !

The action defined in subflow return the ID of 'purchase.requisition' instead of 'purchase.order'. This creates the problem.

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Jamotion GmbH (p-infg-s) wrote :

Is this bug fix already planed? Without this bug fix we can't go live with OpenERP and we do not have enough knowledge for self fixing this error. Thanks for any help!

Amit Parik (amit-parik)
tags: added: purchase
Revision history for this message
Leigh Willard (leigh) wrote :

has this been fixed and released?

Revision history for this message
Omal Bastin (omalbastin) wrote :

I dont know whether this bug is fixed or not. I had made a patch which is working fine for me. Please check it.

Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Well I had fixed this bug sometime back, merge proposal here,
https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-593185-rha/+merge/166651

This branches fixes several issues regarding procurement order and to solve this bug you need to use fix on line 135-139.
Mehul has fixed this for trunk and I think his fix should solve the problem too.

Regards,
Rifakat

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.