From 6f2be32fcff40b7785fa8df32be0b47315fe3dc4 Mon Sep 17 00:00:00 2001 From: mso Date: Tue, 30 Mar 2010 16:02:08 +0530 Subject: [PATCH] [IMP] stock:inventory_merge wizard has been converted into osv memory bzr revid: mso@mso-20100330103208-ftvqnm43yujxazku --- addons/stock/__terp__.py | 1 + addons/stock/wizard/stock_inventory_merge.py | 16 ++++++++--- .../wizard/stock_inventory_merge_view.xml | 27 +++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 addons/stock/wizard/stock_inventory_merge_view.xml diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index bfbcafd2e28..4f500f78673 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -48,6 +48,7 @@ Thanks to the double entry management, the inventory controlling is powerful and "wizard/stock_inventory_set_stock_zero_view.xml", "wizard/stock_fill_inventory_view.xml", "wizard/stock_invoice_onshipping_view.xml", + "wizard/stock_inventory_merge_view.xml", "wizard/stock_location_product_view.xml", "wizard/stock_inventory_line_split_view.xml", "wizard/stock_change_standard_price_view.xml", diff --git a/addons/stock/wizard/stock_inventory_merge.py b/addons/stock/wizard/stock_inventory_merge.py index 64620054ff8..1c11ad8e2ad 100644 --- a/addons/stock/wizard/stock_inventory_merge.py +++ b/addons/stock/wizard/stock_inventory_merge.py @@ -36,7 +36,18 @@ class stock_inventory_merge(osv.osv_memory): } def do_merge(self, cr, uid, ids, context): - + """ + To merge selected Inventories. + + @param self: The object pointer. + @param cr: A database cursor + @param uid: ID of the user currently logged in + @param ids: List of IDs selected + @param context: A standard dictionary + + @return: + + """ invent_obj = self.pool.get('stock.inventory') invent_line_obj = self.pool.get('stock.inventory.line') @@ -46,10 +57,7 @@ class stock_inventory_merge(osv.osv_memory): raise osv.except_osv(_('Warning'), _('Please select at least two inventories.')) - - for inventory in invent_obj.browse(cr, uid, context['active_ids'], context=context): - print"-------active-ids----",context['active_ids'] if inventory.state == "done": raise osv.except_osv(_('Warning'), _('Merging is only allowed on draft inventories.')) diff --git a/addons/stock/wizard/stock_inventory_merge_view.xml b/addons/stock/wizard/stock_inventory_merge_view.xml new file mode 100644 index 00000000000..e8af34c0c71 --- /dev/null +++ b/addons/stock/wizard/stock_inventory_merge_view.xml @@ -0,0 +1,27 @@ + + + + + + stock.inventory.merge.form + stock.inventory.merge + form + +
+ +