Make picking wizard, one2many field bug

Bug #435299 reported by Xavier Fernandez http://www.smile.fr
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web Client
Fix Released
Undecided
Unassigned

Bug Description

The "Make picking" wizard of the stock module does not work on web-client 5.0.2 (pickings are not modified) but do work with the gtk client.
(server 5.0, addons 5.0, minimal profile, module stock and its dependencies installed)
I create 2 pickings, 1 with status draft(id:1), the other with status done(id:2).
I select both and apply the "Make picking" wizard.

I've modified stock/wizard/wizard_picking_make.py to get a clue of what is happening:
def _get_value(obj, cursor, user, data, context):
    pool = pooler.get_pool(cursor.dbname)
    picking_obj = pool.get('stock.picking')
    print "_get_value data", data
    picking_ids = picking_obj.search(cursor, user, [
        ('id', 'in', data['ids']),
        ('state', '<>', 'done'),
        ('state', '<>', 'cancel')], context=context)
    print "_get_value picking_ids", picking_ids
    return {'pickings': picking_ids}

def _make_packing(obj, cursor, user, data, context):
    wkf_service = netsvc.LocalService('workflow')
    pool = pooler.get_pool(cursor.dbname)
    picking_obj = pool.get('stock.picking')
    ids = [x[1] for x in data['form']['pickings']]
    print "_make_packing data", data
    print "_make_packing ids", ids
    picking_obj.force_assign(cursor, user, ids)
    picking_obj.action_move(cursor, user, ids)
    for picking_id in ids:
        wkf_service.trg_validate(user, 'stock.picking', picking_id,
                'button_done', cursor)
    return {}

===================================================================
With web client:
_get_value data {'model': 'stock.picking', 'form': {}, 'id': 1, 'report_type': 'pdf', 'ids': [1, 2]}
_get_value picking_ids [1]
_get_value data {'form': {'pickings': [1]}, 'ids': [1, 2], 'report_type': 'pdf', 'model': 'stock.picking', 'id': 1}
_get_value picking_ids [1]
_make_packing data {'form': {'pickings': {}}, 'ids': [1, 2], 'report_type': 'pdf', 'model': 'stock.picking', 'id': 1}
_make_packing ids []
===================================================================
With gtk client:
_get_value data {'model': u'stock.picking', 'form': {}, 'id': 1, 'report_type': 'pdf', 'ids': [1, 2]}
_get_value picking_ids [1]
_make_packing data {'form': {'pickings': [(1, 1, {'origin': False, 'address_id': False, 'backorder_id': False, 'invoice_state': u'none', 'min_date': '2009-09-23 16:23:59', 'state': u'draft', 'date': '2009-09-23 16:23:55', 'name': u'PACK1'})]}, 'ids': [1, 2], 'report_type': 'pdf', 'model': u'stock.picking', 'id': 1}
_make_packing ids [1]

Related branches

Changed in openobject-client-web:
status: New → Confirmed
Revision history for this message
Amit Mendapara (cristatus) wrote :

Fixed in revision 2703 of branch 5.0.2

Changed in openobject-client-web:
status: Confirmed → 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.