Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
14694 Представления

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
        }

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
мар. 15
4645
3
сент. 18
5579
0
февр. 16
3672
0
авг. 15
5518
1
мар. 15
468