[IMP] stock:inventory_merge wizard has been converted into osv memory
bzr revid: mso@mso-20100330103208-ftvqnm43yujxazku
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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.'))
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="name_form" model="ir.ui.view">
|
||||
<field name="name">stock.inventory.merge.form</field>
|
||||
<field name="model">stock.inventory.merge</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Merge inventories">
|
||||
<separator colspan="4" string="Merge inventories" />
|
||||
<label string="Do you want to merge theses inventories ?"/>
|
||||
<button special="cancel" string="Cancel" icon='gtk-cancel'/>
|
||||
<button name="do_merge" string="Yes" type="object" icon="gtk-apply"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<act_window name="Merge inventories"
|
||||
res_model="stock.inventory.merge"
|
||||
src_model="stock.inventory"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_view_stock_merge_inventories"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user