You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
948 B

# -*- coding: utf-8 -*-
from openerp import api, fields, models
class StockPackOperation(models.Model):
_inherit = 'stock.picking'
@api.multi
def actions_on_articles(self):
ids = self._ids
context = self._context
ctx = (context or {}).copy()
ctx['articles'] = []
for line in self.browse(ids).pack_operation_ids:
ctx['articles'].append(line.product_id.product_tmpl_id.id)
if ctx['articles']:
return {
'name': 'Articles',
'view_type': 'list',
'view_mode': 'list',
'res_model': 'product.template',
'view_id': False,
'target': 'current',
'type': 'ir.actions.act_window',
'context': ctx,
'nodestroy': True,
'res_id': ctx['articles'],
'domain': [('id', '=', ctx['articles'])],
}