##############################################################################
from osv import fields, osv
-from service import web_services
-from tools.misc import UpdateableStr, UpdateableDict
-from tools.translate import _
-import netsvc
-import pooler
-import time
-import wizard
class stock_location_product(osv.osv_memory):
_name = "stock.location.product"
_description = "Products by Location"
_columns = {
- 'from_date': fields.datetime('From'),
- 'to_date': fields.datetime('To'),
- }
+ 'from_date': fields.datetime('From'),
+ 'to_date': fields.datetime('To'),
+ }
- def action_open_window(self, cr, uid, ids, context):
+ def action_open_window(self, cr, uid, ids, context=None):
+ """ To open location wise product information specific to given duration
+ @param self: The object pointer.
+ @param cr: A database cursor
+ @param uid: ID of the user currently logged in
+ @param ids: An ID or list of IDs if we want more than one
+ @param context: A standard dictionary
+ @return: Invoice type
+ """
mod_obj = self.pool.get('ir.model.data')
- for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date']):
- result = mod_obj._get_id(cr, uid, 'product', 'product_search_form_view')
- id = mod_obj.read(cr, uid, result, ['res_id'])
+ for location_obj in self.read(cr, uid, ids, ['from_date', 'to_date'], context=context):
return {
- 'name': 'product',
- 'view_type': 'form',
- 'view_mode': 'tree,form',
- 'res_model': 'product.product',
- 'type': 'ir.actions.act_window',
- 'context': {'location': context['active_ids'][0],
- 'from_date': location_obj['from_date'],
- 'to_date': location_obj['to_date']},
- 'domain': [('type', '<>', 'service')],
- 'search_view_id': id['res_id']
- }
+ 'name': False,
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'product.product',
+ 'type': 'ir.actions.act_window',
+ 'context': {'location': context['active_id'],
+ 'from_date': location_obj['from_date'],
+ 'to_date': location_obj['to_date']},
+ 'domain': [('type', '<>', 'service')],
+ }
stock_location_product()