[trunk][mrp] stock_move.action_consume raises exception

Bug #669210 reported by Tamás Dénes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

In the mrp modul's Manufacturing Order form clicking on the "Produce" then the "Confirm" buttons raises an AttributeError exception with the message 'stock.move' object has no attribute 'split_lines'. This occurs only if there are raw materials in the BOM list on which the "Track Manufacturing Lots" attribute is checked.
The problem seems to be the result of some untested and incomplete refactoring. (Probably at revision 3038.1.7)

The traceback is as follows:

Traceback (most recent call last):
  File "/home/tomi/openerp/server/bin/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/home/tomi/openerp/server/bin/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/tomi/openerp/server/bin/osv/osv.py", line 57, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/tomi/openerp/server/bin/osv/osv.py", line 140, in execute
    res = pool.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/tomi/openerp/server/bin/osv/osv.py", line 130, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/tomi/openerp/addons/mrp/wizard/mrp_product_produce.py", line 72, in do_produce
    data['product_qty'], data['mode'], context=context)
  File "/home/tomi/openerp/addons/mrp/mrp.py", line 684, in action_produce
    stock_mov_obj.action_consume(cr, uid, [raw_product.id], consumed_qty, production.location_src_id.id, context=context)
  File "/home/tomi/openerp/addons/mrp/stock.py", line 109, in action_consume
    new_moves = super(StockMove, self).action_consume(cr, uid, [move.id], product_qty, location_id, context=context)
  File "/home/tomi/openerp/addons/stock/stock.py", line 2234, in action_consume
    res += self.split_lines(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
AttributeError: 'stock.move' object has no attribute 'split_lines'

Tags: mrp stock

Related branches

Revision history for this message
Jamin Shah(OpenERP) (jamin-openerp) wrote :

Hello Tamas Denes,

Would you please provide me more information with proper steps to
reproduce this at my end?

Thanks

Changed in openobject-addons:
status: New → Incomplete
Changed in openobject-addons:
status: Incomplete → Confirmed
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

I confirm the bug, split_lines is nowhere in the code. I think it's action_split instead of split_lines.

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
Changed in openobject-addons:
status: Confirmed → In Progress
Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Rohan Nayani(Open ERP) (ron-tinyerp) wrote :

HelloTamás Dénes

Thanks for reporting,
It has been fixed inlp:~openerp-dev/openobject-addons/ron-dev-addons2
Revision ID: <email address hidden>
Revision num: 5044.
It will be available in trunk soon,

Changed in openobject-addons:
status: Fix Committed → Fix Released
Revision history for this message
Tamás Dénes (tamas-denes) wrote :

I've just checked this function since it has been fixed. I found that this patch solved the problem reported above but introduced two new ones.

The new problems are:

1. After consuming the raw materials they appear in the right side list doubled. (Every item is displayed twice in Consumed Products). Initially the duplicated lines show only a quantity of 0 but after double clicking on any line the duplicates will be shown.

2. A new LOT is generated for each consumed raw material after invoking consume. So the system wants to consume materials from such LOTs where there is 0 quantity in stock. These new LOTs will have a negative stock quantity and these LOTs are used for nothing. At the same time stock quantities in the work center locations keep increasing because the user sets the right LOTs on the Internal Moves lines but the system doesn't consume raw materials from these LOTs.

The mechanism mentioned in the second problem should be changed so that Production LOT should not be generated for the Consumed Products but should the LOTs copied from the Internal Move lines (Picking List). This way the system would work as intended.

Changed in openobject-addons:
status: Fix Released → Triaged
status: Triaged → Fix Released
Revision history for this message
Tamás Dénes (tamas-denes) wrote :

I've committed the bugreport #691012 with the problems mentioned above.

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.