跳至内容
菜单
此问题已终结
1 回复
14689 查看

please I want to open Return lines by python ? my code is 

res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'view_stock_return_picking_form')
             #raise osv.except_osv((res),())
             picking_id = self.browse(cr, uid, ids[0], context=context).picking_id.id
             #assert len(ids) == 1, 'This option should only be used for a single id at a time'
             return {
                'name': _('Return lines'),
                'view_type': 'form',
                'view_mode': 'form',
                'view_id': res and res[1] or False,
                'res_model': 'stock.return.picking',
                'src_model': "stock.picking",
                'type': 'ir.actions.act_window',
                'nodestroy': True,
                'target': 'current',
                'key2':"client_action_multi",
                'res_id': picking_id,
             }

but not open please help me for this issue thank you so much?

形象
丢弃
最佳答案

hi,

try this:

res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'view_stock_return_picking_form')
res_id = res and res[1] or False
#raise osv.except_osv((res),())
picking_id = self.browse(cr, uid, ids[0], context=context).picking_id.id
#assert len(ids) == 1, 'This option should only be used for a single id at a time'
return {
        'name': _('Return lines'),
        'view_type': 'form',
        'view_mode': 'form',
        'view_id': [res_id],
        'res_model': 'stock.return.picking',
        'type': 'ir.actions.act_window',
        'target': 'current',
                'context':context
        }

形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
4638
3
9月 18
5575
0
2月 16
3670
0
8月 15
5513
1
3月 15
467