[FIX]stock_picking_wave: add possibility to print all picking at once and remove inherited view for picking in/out object
bzr revid: csn@openerp.com-20130729152012-hjvziouhcrh5mgk4
This commit is contained in:
parent
bbb01b95a3
commit
5cd172d276
|
@ -24,6 +24,27 @@ class stock_picking_wave(osv.osv):
|
|||
self.pool.get('stock.picking').action_cancel(cr, uid, picking_todo, context=context)
|
||||
return True
|
||||
|
||||
def print_picking(self, cr, uid, ids, context=None):
|
||||
'''
|
||||
This function print the report for all picking_ids associated to the picking wave
|
||||
'''
|
||||
assert len(ids) == 1, 'This option should only be used for a single wave picking at a time.'
|
||||
browse_picking_ids = self.browse(cr, uid, ids, context)[0].picking_ids
|
||||
picking_ids = []
|
||||
for picking in browse_picking_ids:
|
||||
picking_ids.append(picking.id)
|
||||
datas = {
|
||||
'ids': picking_ids,
|
||||
'model': 'stock.picking',
|
||||
'form': self.read(cr, uid, picking_ids[0], context=context)
|
||||
}
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'stock.picking.list',
|
||||
'datas': datas,
|
||||
'nodestroy' : True
|
||||
}
|
||||
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
_inherit = "stock.picking"
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<div class="oe_right oe_button_box">
|
||||
<button name="confirm_picking" string="Confirm all pickings" type="object"/>
|
||||
<button name="cancel_picking" string="Cancel all pickings" type="object"/>
|
||||
<button name="print_picking" string="Print all pickings" type="object"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
|
@ -91,29 +92,5 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_stock_picking_in_wave_inherit">
|
||||
<field name="name">stock.picking.in.wave.inherit.form</field>
|
||||
<field name="model">stock.picking.in</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_in_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='auto_picking']" position="after">
|
||||
<field name="wave_id"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="view_stock_picking_out_wave_inherit">
|
||||
<field name="name">stock.picking.out.wave.inherit.form</field>
|
||||
<field name="model">stock.picking.out</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_out_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='auto_picking']" position="after">
|
||||
<field name="wave_id"/>
|
||||
</xpath>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue