[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',
|
'website': 'http://www.openerp.com',
|
||||||
'depends': ['stock'],
|
'depends': ['stock'],
|
||||||
'data': ['security/ir.model.access.csv',
|
'data': ['security/ir.model.access.csv',
|
||||||
'stock_picking_wave_view.xml'],
|
'stock_picking_wave_view.xml',
|
||||||
|
'stock_picking_wave_sequence.xml'],
|
||||||
'demo': [],
|
'demo': [],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': True,
|
'auto_install': True,
|
||||||
|
|
|
@ -11,7 +11,12 @@ class stock_picking_wave(osv.osv):
|
||||||
'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'),
|
'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': 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'),
|
'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):
|
def confirm_picking(self, cr, uid, ids, context=None):
|
||||||
picking_todo = self.pool.get('stock.picking').search(cr, uid, [('wave_id', 'in', ids)], context=context)
|
picking_todo = self.pool.get('stock.picking').search(cr, uid, [('wave_id', 'in', ids)], context=context)
|
||||||
|
@ -42,6 +47,23 @@ class stock_picking_wave(osv.osv):
|
||||||
'nodestroy': True
|
'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):
|
class stock_picking(osv.osv):
|
||||||
_inherit = "stock.picking"
|
_inherit = "stock.picking"
|
||||||
|
|
|
@ -5,41 +5,51 @@
|
||||||
<field name="model">stock.picking.wave</field>
|
<field name="model">stock.picking.wave</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Stock Picking Waves" version="7.0">
|
<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>
|
<sheet>
|
||||||
<div class="oe_right oe_button_box">
|
<div class="oe_right oe_button_box">
|
||||||
<button name="confirm_picking" string="Confirm all pickings" type="object"/>
|
<button name="confirm_picking" string="Confirm all pickings" type="object"/>
|
||||||
<button name="cancel_picking" string="Cancel all pickings" type="object"/>
|
<button name="cancel_picking" string="Cancel all pickings" type="object"/>
|
||||||
<button name="print_picking" string="Print all internal pickings" type="object" context="{'report':'stock.picking.list.internal'}"/>
|
<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'}"/>
|
<button name="print_picking" string="Print all in/out pickings" type="object" context="{'report':'stock.picking.list'}"/>
|
||||||
</div>
|
|
||||||
<group>
|
|
||||||
<group>
|
|
||||||
<field name="name"/>
|
|
||||||
<field name="partner_id"/>
|
|
||||||
</group>
|
|
||||||
<group>
|
|
||||||
<label for="capacity"/>
|
|
||||||
<div>
|
|
||||||
<field name="capacity" class="oe_inline"/>
|
|
||||||
<field name="capacity_uom" class="oe_inline"/>
|
|
||||||
</div>
|
</div>
|
||||||
<field name="time" widget="float_time"/>
|
<div class="oe_title">
|
||||||
</group>
|
<h1>
|
||||||
</group>
|
<field name="name" class="oe_inline" readonly="1"/>
|
||||||
<separator string="Pickings"/>
|
</h1>
|
||||||
<field name="picking_ids" widget="many2many">
|
</div>
|
||||||
<tree>
|
|
||||||
<field name="name"/>
|
<group>
|
||||||
<field name="backorder_id"/>
|
<group>
|
||||||
<field name="origin"/>
|
<field name="partner_id"/>
|
||||||
<field name="date"/>
|
</group>
|
||||||
<field name="min_date"/>
|
<group>
|
||||||
<field name="invoice_state"/>
|
<label for="capacity"/>
|
||||||
<field name="state"/>
|
<div>
|
||||||
<button name="action_done" string="Confirm picking" type="object" icon="gtk-apply" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}"/>
|
<field name="capacity" class="oe_inline"/>
|
||||||
<button name="action_cancel" string="Cancel picking" type="object" icon="gtk-cancel" attrs="{'invisible': [('state', 'in', ('done', 'cancel'))]}"/>
|
<field name="capacity_uom" class="oe_inline"/>
|
||||||
</tree>
|
</div>
|
||||||
</field>
|
<field name="time" widget="float_time"/>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<separator string="Pickings"/>
|
||||||
|
|
||||||
|
<field name="picking_ids" widget="many2many">
|
||||||
|
<tree>
|
||||||
|
<field name="name"/>
|
||||||
|
<field name="backorder_id"/>
|
||||||
|
<field name="origin"/>
|
||||||
|
<field name="date"/>
|
||||||
|
<field name="min_date"/>
|
||||||
|
<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'))]}"/>
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
</sheet>
|
</sheet>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
@ -60,6 +70,15 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</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">
|
<record id="action_picking_wave" model="ir.actions.act_window">
|
||||||
<field name="name">Picking Waves</field>
|
<field name="name">Picking Waves</field>
|
||||||
|
@ -67,6 +86,8 @@
|
||||||
<field name="res_model">stock.picking.wave</field>
|
<field name="res_model">stock.picking.wave</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,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">
|
<field name="help" type="html">
|
||||||
<p class="oe_view_nocontent_create">
|
<p class="oe_view_nocontent_create">
|
||||||
Click to create a Picking Wave.
|
Click to create a Picking Wave.
|
||||||
|
|
Loading…
Reference in New Issue