[MERGE] picking wave improvements
bzr revid: qdp-launchpad@openerp.com-20130801152215-g1i4dj3whlilkn8z
This commit is contained in:
commit
7813452daf
|
@ -31,7 +31,8 @@ This module adds the picking wave option in warehouse management.
|
|||
'website': 'http://www.openerp.com',
|
||||
'depends': ['stock'],
|
||||
'data': ['security/ir.model.access.csv',
|
||||
'stock_picking_wave_view.xml'],
|
||||
'stock_picking_wave_view.xml',
|
||||
'stock_picking_wave_sequence.xml'],
|
||||
'demo': [],
|
||||
'installable': True,
|
||||
'auto_install': True,
|
||||
|
|
|
@ -11,6 +11,11 @@ class stock_picking_wave(osv.osv):
|
|||
'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'),
|
||||
'capacity': fields.float('Capacity', help='The capacity of the transport used to get the goods'),
|
||||
'capacity_uom': fields.many2one('product.uom', 'Unit of Measure', help='The Unity Of Measure of the transport capacity'),
|
||||
'state': fields.selection([('in_progress', 'Running'), ('done', 'Done')], required=True),
|
||||
}
|
||||
_defaults = {
|
||||
'name': '/',
|
||||
'state': 'in_progress',
|
||||
}
|
||||
|
||||
def confirm_picking(self, cr, uid, ids, context=None):
|
||||
|
@ -42,6 +47,23 @@ class stock_picking_wave(osv.osv):
|
|||
'nodestroy': True
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if vals.get('name', '/') == '/':
|
||||
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'picking.wave') or '/'
|
||||
return super(stock_picking_wave, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context=None):
|
||||
if not default:
|
||||
default = {}
|
||||
default.update({
|
||||
'state': 'in_progress',
|
||||
'name': self.pool.get('ir.sequence').get(cr, uid, 'picking.wave'),
|
||||
})
|
||||
return super(stock_picking_wave, self).copy(cr, uid, id, default=default, context=context)
|
||||
|
||||
def done(self, cr, uid, ids, context=None):
|
||||
return self.write(cr, uid, ids, {'state': 'done'}, context=context)
|
||||
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
_inherit = "stock.picking"
|
||||
|
|
|
@ -5,6 +5,10 @@
|
|||
<field name="model">stock.picking.wave</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Stock Picking Waves" version="7.0">
|
||||
<header>
|
||||
<button name="done" states="in_progress" string="Done" type="object" class="oe_highlight"/>
|
||||
<field name="state" widget="statusbar"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_right oe_button_box">
|
||||
<button name="confirm_picking" string="Confirm all pickings" type="object"/>
|
||||
|
@ -12,9 +16,14 @@
|
|||
<button name="print_picking" string="Print all internal pickings" type="object" context="{'report':'stock.picking.list.internal'}"/>
|
||||
<button name="print_picking" string="Print all in/out pickings" type="object" context="{'report':'stock.picking.list'}"/>
|
||||
</div>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" class="oe_inline" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<group>
|
||||
<group>
|
||||
<field name="name"/>
|
||||
<field name="partner_id"/>
|
||||
</group>
|
||||
<group>
|
||||
|
@ -26,7 +35,9 @@
|
|||
<field name="time" widget="float_time"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<separator string="Pickings"/>
|
||||
|
||||
<field name="picking_ids" widget="many2many">
|
||||
<tree>
|
||||
<field name="name"/>
|
||||
|
@ -34,7 +45,6 @@
|
|||
<field name="origin"/>
|
||||
<field name="date"/>
|
||||
<field name="min_date"/>
|
||||
<field name="invoice_state"/>
|
||||
<field name="state"/>
|
||||
<button name="action_done" string="Confirm picking" type="object" icon="gtk-apply" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}"/>
|
||||
<button name="action_cancel" string="Cancel picking" type="object" icon="gtk-cancel" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}"/>
|
||||
|
@ -60,6 +70,15 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_picking_wave_filter" model="ir.ui.view">
|
||||
<field name="name">picking.wave.filter</field>
|
||||
<field name="model">stock.picking.wave</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Picking Waves">
|
||||
<filter name="in_progress" string="In progress" domain="[('state','=','in_progress')]" help="Picking Waves not finished"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_wave" model="ir.actions.act_window">
|
||||
<field name="name">Picking Waves</field>
|
||||
|
@ -67,6 +86,8 @@
|
|||
<field name="res_model">stock.picking.wave</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="context">{"search_default_in_progress" : True,}</field>
|
||||
<field name="search_view_id" ref="view_picking_wave_filter"/>
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to create a Picking Wave.
|
||||
|
|
Loading…
Reference in New Issue