From 2b31b2471a84d98fee08c06b334503ba85a4c16d Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 6 Sep 2010 16:17:40 +0530 Subject: [PATCH] [REM] stock: Remove the traceability wizard view bzr revid: sbh@tinyerp.com-20100906104740-6bvqsdt5t30p0h5j --- addons/stock/__openerp__.py | 1 - addons/stock/stock.py | 38 +----- addons/stock/wizard/stock_traceability.py | 47 +------- .../stock/wizard/stock_traceability_view.xml | 108 ------------------ 4 files changed, 5 insertions(+), 189 deletions(-) delete mode 100644 addons/stock/wizard/stock_traceability_view.xml diff --git a/addons/stock/__openerp__.py b/addons/stock/__openerp__.py index 3fb9e2c741a..e33e347d612 100644 --- a/addons/stock/__openerp__.py +++ b/addons/stock/__openerp__.py @@ -57,7 +57,6 @@ Thanks to the double entry management, the inventory controlling is powerful and "wizard/stock_splitinto_view.xml", "wizard/stock_inventory_line_split_view.xml", "wizard/stock_change_standard_price_view.xml", - "wizard/stock_traceability_view.xml", 'wizard/stock_picking_make_view.xml', 'wizard/stock_return_picking_view.xml', "stock_workflow.xml", diff --git a/addons/stock/stock.py b/addons/stock/stock.py index bb0c1854276..a4e0a890a2f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -532,24 +532,8 @@ class stock_tracking(osv.osv): @param context: A standard dictionary @return: A dictionary of values """ - # Refactor Need - type1 = context['type'] or 'move_history_ids' - field = context['field'] or 'tracking_id' - obj = self.pool.get('stock.move') - ids = obj.search(cr, uid, [(field, 'in',context['active_ids'])]) - cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type1, 'tree')) - view_id = cr.fetchone()[0] - value = { - 'domain': "[('id','in',["+','.join(map(str, ids))+"])]", - 'name': ((type1=='move_history_ids') and 'Upstream Traceability') or 'Downstream Traceability', - 'view_type': 'tree', - 'res_model': 'stock.move', - 'field_parent': type1, - 'view_id': (view_id,'View'), - 'type': 'ir.actions.act_window', - 'nodestroy':True, - - } + value={} + value=self.pool.get('action.traceability').action_traceability(cr,uid,ids,context) return value stock_tracking() @@ -1384,23 +1368,7 @@ class stock_production_lot(osv.osv): @param context: A standard dictionary @return: A dictionary of values """ - type1 = context['type'] or 'move_history_ids' - field = context['field'] or 'tracking_id' - obj = self.pool.get('stock.move') - ids = obj.search(cr, uid, [(field, 'in',context['active_ids'])]) - cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type1, 'tree')) - view_id = cr.fetchone()[0] - value = { - 'domain': "[('id','in',["+','.join(map(str, ids))+"])]", - 'name': ((type1=='move_history_ids') and 'Upstream Traceability') or 'Downstream Traceability', - 'view_type': 'tree', - 'res_model': 'stock.move', - 'field_parent': type1, - 'view_id': (view_id,'View'), - 'type': 'ir.actions.act_window', - 'nodestroy':True, - - } + value=self.pool.get('action.traceability').action_traceability(cr,uid,ids,context) return value stock_production_lot() diff --git a/addons/stock/wizard/stock_traceability.py b/addons/stock/wizard/stock_traceability.py index d1d799ca061..01be5efdcd2 100644 --- a/addons/stock/wizard/stock_traceability.py +++ b/addons/stock/wizard/stock_traceability.py @@ -52,55 +52,12 @@ class action_traceability(osv.osv_memory): 'res_model': 'stock.move', 'field_parent': type1, 'view_id': (view_id,'View'), - 'type': 'ir.actions.act_window' + 'type': 'ir.actions.act_window', + 'nodestroy':True, } return value action_traceability() -class stock_traceability_downstream(osv.osv_memory): - """ - This class is defined for Stock traceability downstream wizard - - """ - _name = "stock.traceability.downstream" - _inherit = "action.traceability" - _description = "Stock traceability downstream" - -stock_traceability_downstream() - -class stock_traceability_upstream(osv.osv_memory): - """ - This class is defined for Stock traceability upstream wizard - - """ - _name = "stock.traceability.upstream" - _inherit = "action.traceability" - _description = "Stock traceability upstream" - -stock_traceability_upstream() - -class stock_traceability_lot_upstream(osv.osv_memory): - """ - This class is defined for Stock traceability lot upstream wizard - - """ - _name = "stock.traceability.lot.upstream" - _inherit = "action.traceability" - _description = "Stock traceability lot upstream" - -stock_traceability_lot_upstream() - -class stock_traceability_lot_downstream(osv.osv_memory): - """ - This class is defined for Stock traceability lot downstream wizard - - """ - _name = "stock.traceability.lot.downstream" - _inherit = "action.traceability" - _description = "Stock traceability lot downstream" - -stock_traceability_lot_downstream() - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/wizard/stock_traceability_view.xml b/addons/stock/wizard/stock_traceability_view.xml deleted file mode 100644 index fc08f783771..00000000000 --- a/addons/stock/wizard/stock_traceability_view.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - Stock traceability downstream - stock.traceability.downstream - form - -
- -