From 0c80a642def16966b708adbc1304594ea7eb4239 Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Tue, 1 Oct 2013 10:28:19 +0200
Subject: [PATCH 1/7] Add button unreserve and field prioriry for picking
bzr revid: jke@openerp.com-20131001082819-gcpxuuqh36fbwcsz
---
addons/stock/stock.py | 33 +++++++++++++++++++++++++++++----
addons/stock/stock_view.xml | 12 +++++++++---
2 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 1fe5dba331f..1e6ec313a5b 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -477,7 +477,7 @@ class stock_picking(osv.osv):
_name = "stock.picking"
_inherit = ['mail.thread']
_description = "Picking List"
- _order = "id desc"
+ _order = "priority desc, date desc, id desc"
def get_min_max_date(self, cr, uid, ids, field_name, arg, context=None):
""" Finds minimum and maximum dates for picking.
@return: Dictionary of values
@@ -550,7 +550,15 @@ class stock_picking(osv.osv):
if pick.pack_operation_ids:
res[pick.id] = True
return res
-
+
+ def _get_quant_reserved_exist(self, cr, uid, ids, field_name, arg, context=None):
+ res = {}
+ for pick in self.browse(cr, uid, ids, context=context):
+ res[pick.id] = False
+ for move in pick.move_lines:
+ if len(move.reserved_quant_ids)>0:
+ res[pick.id] = True
+ return res
def _get_group_id(self, cr, uid, ids, field_name, args, context=None):
res = {}
@@ -586,6 +594,8 @@ class stock_picking(osv.osv):
* Transferred: has been processed, can't be modified or cancelled anymore\n
* Cancelled: has been cancelled, can't be confirmed anymore"""
),
+ 'priority': fields.selection([('0', 'Low'), ('1', 'Normal'), ('2', 'High')], string='Priority', required=True),
+
'min_date': fields.function(get_min_max_date, multi="min_max_date",
store={'stock.move': (_get_pickings, ['state', 'date_expected'], 20)}, type='datetime', string='Scheduled Date', select=1, help="Scheduled time for the first part of the shipment to be processed"),
'max_date': fields.function(get_min_max_date, multi="min_max_date",
@@ -593,6 +603,7 @@ class stock_picking(osv.osv):
'date': fields.datetime('Commitment Date', help="Date promised for the completion of the transfer order, usually set the time of the order and revised later on.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'date_done': fields.datetime('Date of Transfer', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'move_lines': fields.one2many('stock.move', 'picking_id', 'Internal Moves', states={'done': [('readonly', True)], 'cancel': [('readonly', True)]}),
+ 'quant_reserved_exist': fields.function(_get_quant_reserved_exist, type='boolean', string='Quant already reserved ?'),
'partner_id': fields.many2one('res.partner', 'Partner', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'company_id': fields.many2one('res.company', 'Company', required=True, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}),
'pack_operation_ids': fields.one2many('stock.pack.operation', 'picking_id', string='Related Packing Operations'),
@@ -610,6 +621,7 @@ class stock_picking(osv.osv):
'name': lambda self, cr, uid, context: '/',
'state': 'draft',
'move_type': 'one',
+ 'priority' : '1', #normal
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
}
@@ -814,7 +826,18 @@ class stock_picking(osv.osv):
self.rereserve(cr, uid, picking_ids, context=context)
-
+ def do_unreserve(self,cr,uid,picking_ids, context=None):
+ """
+ Will remove all quants for picking in picking_ids
+ """
+ ids_to_free = []
+ quant_obj = self.pool.get("stock.quant")
+ for picking in self.browse(cr, uid, picking_ids, context=context):
+ for move in picking.move_lines:
+ ids_to_free += [quant.id for quant in move.reserved_quant_ids]
+ if ids_to_free:
+ quant_obj.write(cr,uid,ids_to_free,{'reservation_id' : False,'reservation_op_id': False }, context = context)
+
def _reserve_quants_ops_move(self, cr, uid, ops, move, qty, create=False, context=None):
"""
@@ -1244,6 +1267,7 @@ class stock_move(osv.osv):
'move_orig_ids': fields.one2many('stock.move', 'move_dest_id', 'Original Move', help="Optional: previous stock move when chaining them", select=True),
'picking_id': fields.many2one('stock.picking', 'Reference', select=True,states={'done': [('readonly', True)]}),
+ 'picking_priority': fields.related('picking_id','priority', type='selection', selection=[('0','Low'),('1','Normal'),('2','High')],relation='stock.picking', string='Picking Priority'),
'note': fields.text('Notes'),
'state': fields.selection([('draft', 'New'),
('cancel', 'Cancelled'),
@@ -1267,7 +1291,7 @@ class stock_move(osv.osv):
# used for colors in tree views:
'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True),
-
+
'quant_ids': fields.many2many('stock.quant', 'stock_quant_move_rel', 'move_id', 'quant_id', 'Quants'),
'reserved_quant_ids': fields.one2many('stock.quant', 'reservation_id', 'Reserved quants'),
'remaining_qty': fields.function(_get_remaining_qty, type='float', string='Remaining Quantity',
@@ -1332,6 +1356,7 @@ class stock_move(osv.osv):
'date_expected': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'procure_method': 'make_to_stock',
'propagate': True,
+ 'picking_priority':'1', #Normal
}
def _prepare_procurement_from_move(self, cr, uid, move, context=None):
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index d2abec65ee4..3e227b82a52 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -574,7 +574,8 @@
-
+
+
@@ -591,10 +592,11 @@
-
+
-
+
+
@@ -637,6 +639,9 @@
+
+
+
@@ -899,6 +904,7 @@
+
From d457de99176eb616d8ee75a82a53d9b2be6395ba Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Tue, 1 Oct 2013 10:59:35 +0200
Subject: [PATCH 2/7] After Review #1 ok
bzr revid: jke@openerp.com-20131001085935-xf1757latwy4vfwr
---
addons/stock/stock.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 1e6ec313a5b..5d111d04e47 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -556,7 +556,7 @@ class stock_picking(osv.osv):
for pick in self.browse(cr, uid, ids, context=context):
res[pick.id] = False
for move in pick.move_lines:
- if len(move.reserved_quant_ids)>0:
+ if len(move.reserved_quant_ids):
res[pick.id] = True
return res
@@ -1267,7 +1267,7 @@ class stock_move(osv.osv):
'move_orig_ids': fields.one2many('stock.move', 'move_dest_id', 'Original Move', help="Optional: previous stock move when chaining them", select=True),
'picking_id': fields.many2one('stock.picking', 'Reference', select=True,states={'done': [('readonly', True)]}),
- 'picking_priority': fields.related('picking_id','priority', type='selection', selection=[('0','Low'),('1','Normal'),('2','High')],relation='stock.picking', string='Picking Priority'),
+ 'picking_priority': fields.related('picking_id','priority', type='selection', selection=[('0','Low'),('1','Normal'),('2','High')], string='Picking Priority'),
'note': fields.text('Notes'),
'state': fields.selection([('draft', 'New'),
('cancel', 'Cancelled'),
From 017683a4b57dae1c783f1aa1361b1854a5f11e4e Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Tue, 1 Oct 2013 11:09:14 +0200
Subject: [PATCH 3/7] len removed
bzr revid: jke@openerp.com-20131001090914-es0m387zjrkm4o8c
---
addons/stock/stock.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 5d111d04e47..e87c3d36db1 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -556,7 +556,7 @@ class stock_picking(osv.osv):
for pick in self.browse(cr, uid, ids, context=context):
res[pick.id] = False
for move in pick.move_lines:
- if len(move.reserved_quant_ids):
+ if move.reserved_quant_ids:
res[pick.id] = True
return res
From 3c047b2332dddc8c6014f8bd306c1f51c32c6dcd Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Tue, 1 Oct 2013 17:29:47 +0200
Subject: [PATCH 4/7] WMS usability - En cours (reste demodata et btn View
picking
bzr revid: jke@openerp.com-20131001152947-hdwtuoqx65mcfsxa
---
addons/procurement/procurement.py | 1 +
addons/procurement/procurement_view.xml | 48 +++++++++++++++++++++++-
addons/stock/procurement.py | 2 +-
addons/stock/stock.py | 8 +++-
addons/stock/stock_data.xml | 14 +++----
addons/stock/stock_view.xml | 21 +++++++++--
addons/stock_picking_wave/__openerp__.py | 5 ++-
7 files changed, 84 insertions(+), 15 deletions(-)
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index 6614a8f7967..2a3293e9050 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -67,6 +67,7 @@ class procurement_group(osv.osv):
'name': lambda self, cr, uid, c: self.pool.get('ir.sequence').get(cr, uid, 'procurement.group') or '',
'move_type': lambda self, cr, uid, c: 'one'
}
+
class procurement_rule(osv.osv):
'''
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index be2ed8fc097..d6548f58bce 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -77,6 +77,48 @@
+
+
+
+ Procurement for Groups
+ procurement.order
+ form
+ tree,form
+ [('group_id','=',active_id)]
+
+
+
+
+
+ procurement.group.form
+ procurement.group
+
+
+
+
+
procurement.order.select
procurement.order
@@ -97,7 +139,7 @@
-
+
Procurement Orders
ir.actions.act_window
@@ -121,6 +163,10 @@
+
+
+
+
Procurements
diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py
index a42cfcd1919..61e3c018abe 100644
--- a/addons/stock/procurement.py
+++ b/addons/stock/procurement.py
@@ -83,7 +83,7 @@ class procurement_rule(osv.osv):
class procurement_order(osv.osv):
_inherit = "procurement.order"
_columns = {
- 'location_id': fields.many2one('stock.location', 'Procurement Location'),
+ 'location_id': fields.many2one('stock.location', 'Procurement Location',required=True),
'move_ids': fields.one2many('stock.move', 'procurement_id', 'Moves', help="Moves created by the procurement"),
'move_dest_id': fields.many2one('stock.move', 'Destination Move', help="Move which caused (created) the procurement"),
}
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index e87c3d36db1..bda4bc6ecd9 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -478,6 +478,12 @@ class stock_picking(osv.osv):
_inherit = ['mail.thread']
_description = "Picking List"
_order = "priority desc, date desc, id desc"
+
+ def _set_min_date(self, cr, uid, id, field, value,arg,context=None):
+ move_obj = self.pool.get("stock.move")
+ move_obj.write(cr,uid,[move.id for move in self.browse(cr,uid,id,context=context).move_lines],{'date_expected' : value })
+
+
def get_min_max_date(self, cr, uid, ids, field_name, arg, context=None):
""" Finds minimum and maximum dates for picking.
@return: Dictionary of values
@@ -596,7 +602,7 @@ class stock_picking(osv.osv):
),
'priority': fields.selection([('0', 'Low'), ('1', 'Normal'), ('2', 'High')], string='Priority', required=True),
- 'min_date': fields.function(get_min_max_date, multi="min_max_date",
+ 'min_date': fields.function(get_min_max_date, multi="min_max_date",fnct_inv=_set_min_date, readonly=False,
store={'stock.move': (_get_pickings, ['state', 'date_expected'], 20)}, type='datetime', string='Scheduled Date', select=1, help="Scheduled time for the first part of the shipment to be processed"),
'max_date': fields.function(get_min_max_date, multi="min_max_date",
store={'stock.move': (_get_pickings, ['state', 'date_expected'], 20)}, type='datetime', string='Max. Expected Date', select=2, help="Scheduled time for the last part of the shipment to be processed"),
diff --git a/addons/stock/stock_data.xml b/addons/stock/stock_data.xml
index 880bc1b6839..7da16df9451 100644
--- a/addons/stock/stock_data.xml
+++ b/addons/stock/stock_data.xml
@@ -105,7 +105,7 @@
- incoming
+ incoming
True
@@ -113,7 +113,7 @@
Delivery Orders
-
+
outgoing
@@ -150,9 +150,6 @@ watch your stock valuation, and track production lots upstream and downstream (b
-
-
-
@@ -168,12 +165,12 @@ watch your stock valuation, and track production lots upstream and downstream (b
- Your Company: Ship Only (MTO)
+ Your Company: Ship Only (MTO)
10
- Your Company: Stock → Customer
+ Your Company: Stock → Customer
move
@@ -259,5 +256,8 @@ watch your stock valuation, and track production lots upstream and downstream (b
+
+
+
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 3e227b82a52..5a8a2533e9e 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -609,7 +609,7 @@
-
+
@@ -640,8 +640,7 @@
-
-
+
@@ -877,7 +876,7 @@
-
+
@@ -1335,12 +1334,25 @@
+
+
+ All Operations
+ stock.picking.type
+ ir.actions.act_window
+ form
+ list,form
+
+
@@ -1616,6 +1628,7 @@
+
diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py
index f98ce3bc1ba..f787c3eb979 100644
--- a/addons/stock_picking_wave/__openerp__.py
+++ b/addons/stock_picking_wave/__openerp__.py
@@ -34,7 +34,10 @@ This module adds the picking wave option in warehouse management.
'stock_picking_wave_view.xml',
'stock_picking_wave_sequence.xml',
'wizard/picking_to_wave_view.xml'],
- 'demo': [],
+ 'demo': [
+ 'stock_picking_wave_data.xml',
+ ],
+
'installable': True,
'auto_install': False,
}
From f13f1ebbce28d55a29a44294918ddabdbbd26c14 Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Wed, 2 Oct 2013 15:42:42 +0200
Subject: [PATCH 5/7] WMS usability (part) + WMS Merge PO
bzr revid: jke@openerp.com-20131002134242-w76s6p03p66wbk16
---
addons/procurement/procurement_view.xml | 9 ++++---
addons/purchase/purchase.py | 24 ++++++-------------
.../purchase/wizard/purchase_order_group.py | 7 +-----
addons/stock_picking_wave/__openerp__.py | 5 ++--
4 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index d6548f58bce..1671124b7fe 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -88,16 +88,16 @@
+
+-->
+
procurement.group.form
@@ -107,7 +107,6 @@
-
diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py
index 5a969154cc7..bc12ca0fa06 100644
--- a/addons/purchase/purchase.py
+++ b/addons/purchase/purchase.py
@@ -832,6 +832,7 @@ class purchase_order(osv.osv):
@return: new purchase order id
"""
+
#TOFIX: merged order line should be unlink
def make_key(br, fields):
list_key = []
@@ -854,14 +855,15 @@ class purchase_order(osv.osv):
context = {}
# Compute what the new orders should contain
-
new_orders = {}
+ order_lines_to_move = []
for porder in [order for order in self.browse(cr, uid, ids, context=context) if order.state == 'draft']:
order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id'))
new_order = new_orders.setdefault(order_key, ({}, []))
new_order[1].append(porder.id)
order_infos = new_order[0]
+
if not order_infos:
order_infos.update({
'origin': porder.origin,
@@ -884,22 +886,9 @@ class purchase_order(osv.osv):
if porder.origin:
order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
+
for order_line in porder.order_line:
- line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'product_id', 'move_dest_id', 'account_analytic_id'))
- o_line = order_infos['order_line'].setdefault(line_key, {})
- if o_line:
- # merge the line with an existing line
- o_line['product_qty'] += order_line.product_qty * order_line.product_uom.factor / o_line['uom_factor']
- else:
- # append a new "standalone" line
- for field in ('product_qty', 'product_uom'):
- field_val = getattr(order_line, field)
- if isinstance(field_val, browse_record):
- field_val = field_val.id
- o_line[field] = field_val
- o_line['uom_factor'] = order_line.product_uom and order_line.product_uom.factor or 1.0
-
-
+ order_lines_to_move += [order_line.id]
allorders = []
orders_info = {}
@@ -913,7 +902,7 @@ class purchase_order(osv.osv):
for key, value in order_data['order_line'].iteritems():
del value['uom_factor']
value.update(dict(key))
- order_data['order_line'] = [(0, 0, value) for value in order_data['order_line'].itervalues()]
+ order_data['order_line'] = [(6, 0, order_lines_to_move)]
# create the new order
context.update({'mail_create_nolog': True})
@@ -926,6 +915,7 @@ class purchase_order(osv.osv):
for old_id in old_ids:
self.redirect_workflow(cr, uid, [(old_id, neworder_id)])
self.signal_purchase_cancel(cr, uid, [old_id]) # TODO Is it necessary to interleave the calls?
+
return orders_info
diff --git a/addons/purchase/wizard/purchase_order_group.py b/addons/purchase/wizard/purchase_order_group.py
index 243f27efea4..70a6b3240ab 100644
--- a/addons/purchase/wizard/purchase_order_group.py
+++ b/addons/purchase/wizard/purchase_order_group.py
@@ -66,12 +66,7 @@ class purchase_order_group(osv.osv_memory):
id = mod_obj.read(cr, uid, result, ['res_id'])
allorders = order_obj.do_merge(cr, uid, context.get('active_ids',[]), context)
- for new_order in allorders:
- proc_ids = proc_obj.search(cr, uid, [('purchase_id', 'in', allorders[new_order])], context=context)
- for proc in proc_obj.browse(cr, uid, proc_ids, context=context):
- if proc.purchase_id:
- proc_obj.write(cr, uid, [proc.id], {'purchase_id': new_order}, context)
-
+
return {
'domain': "[('id','in', [" + ','.join(map(str, allorders.keys())) + "])]",
'name': _('Purchase Orders'),
diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py
index f787c3eb979..15de1fe308d 100644
--- a/addons/stock_picking_wave/__openerp__.py
+++ b/addons/stock_picking_wave/__openerp__.py
@@ -33,9 +33,10 @@ This module adds the picking wave option in warehouse management.
'data': ['security/ir.model.access.csv',
'stock_picking_wave_view.xml',
'stock_picking_wave_sequence.xml',
- 'wizard/picking_to_wave_view.xml'],
+ 'wizard/picking_to_wave_view.xml',
+ ],
'demo': [
- 'stock_picking_wave_data.xml',
+ 'stock_picking_wave_demo.xml',
],
'installable': True,
From 9b7712bedcf317c5dd2800847eb9ee5411ef616b Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Thu, 3 Oct 2013 15:35:03 +0200
Subject: [PATCH 6/7] continue WMS usability
bzr revid: jke@openerp.com-20131003133503-b18t7or3ff3stqeg
---
addons/procurement/procurement_view.xml | 23 +++----------------
addons/purchase/stock_view.xml | 1 +
addons/stock/stock.py | 2 +-
addons/stock/stock_view.xml | 19 +++++++++++++++
addons/stock_location/stock_location.py | 22 ++++++++++++++----
.../stock_multi_warehouse.yml | 1 +
addons/stock_picking_wave/__openerp__.py | 5 +++-
.../stock_picking_wave/stock_picking_wave.py | 1 -
8 files changed, 47 insertions(+), 27 deletions(-)
diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index 1671124b7fe..f203996b541 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -77,9 +77,8 @@
-
-
+
Procurement for Groups
procurement.order
form
@@ -87,26 +86,14 @@
[('group_id','=',active_id)]
-
-
-
-
+
procurement.group.form
procurement.group
-
-
-
-
Procurements
ir.actions.act_window
diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml
index 18ad626b84b..b5343f39c91 100644
--- a/addons/purchase/stock_view.xml
+++ b/addons/purchase/stock_view.xml
@@ -76,5 +76,6 @@
+
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index bda4bc6ecd9..eaf0778f35f 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -2146,7 +2146,7 @@ class stock_warehouse(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
'partner_id': fields.many2one('res.partner', 'Address'),
'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True, domain=[('usage', '=', 'internal')]),
- 'code': fields.char('Warehouse Unique Identifier', size=5, required=True, help="Short name used to identify your warehouse"),
+ 'code': fields.char('Warehouse Unique Identifier', size=5, required=True, help="Short name used to identify your warehouse"),
}
def _default_stock_id(self, cr, uid, context=None):
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 5a8a2533e9e..53f76cc765f 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1868,5 +1868,24 @@
+
+
+ Pickings for Groups
+ stock.picking
+ form
+ tree,form
+ [('group_id','=',active_id)]
+
+
+ procurement.group.form.herited
+ procurement.group
+
+
+
+
+
+
+
+
diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py
index 0df162489a6..a3946ec2b9a 100644
--- a/addons/stock_location/stock_location.py
+++ b/addons/stock_location/stock_location.py
@@ -62,7 +62,7 @@ class stock_warehouse(osv.osv):
}
_defaults = {
'reception_steps': 'one_step',
- 'delivery_steps': 'ship_only',
+ 'delivery_steps': 'ship_only',
}
def switch_location(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None):
@@ -274,7 +274,9 @@ class stock_warehouse(osv.osv):
route_obj.write(cr, uid, set_active_route_ids, {'active': True}, context=context)
return True
+
def create(self, cr, uid, vals, context=None):
+
if context is None:
context = {}
if vals is None:
@@ -368,6 +370,15 @@ class stock_warehouse(osv.osv):
output_loc = wh_output_stock_loc
if warehouse.delivery_steps == 'ship_only':
output_loc = wh_stock_loc
+
+ color = 0
+ all_used_color = self.pool.get('stock.picking.type').search_read(cr,uid, [('warehouse_id','!=',False),('color','!=',False)],['color'],order='color')
+ for nColor in all_used_color:
+ if nColor['color'] == color and color < 9:
+ color += 1
+ elif nColor['color'] > color or color == 9:
+ break;
+
in_picking_type_id = picking_type_obj.create(cr, uid, vals={
'name': _('Receptions'),
'warehouse_id': new_id,
@@ -375,7 +386,8 @@ class stock_warehouse(osv.osv):
'auto_force_assign': True,
'sequence_id': in_seq_id,
'default_location_src_id': supplier_loc.id,
- 'default_location_dest_id': input_loc.id}, context=context)
+ 'default_location_dest_id': input_loc.id,
+ 'color' : color }, context=context)
out_picking_type_id = picking_type_obj.create(cr, uid, vals={
'name': _('Delivery Orders'),
'warehouse_id': new_id,
@@ -383,7 +395,8 @@ class stock_warehouse(osv.osv):
'sequence_id': out_seq_id,
'delivery': True,
'default_location_src_id': output_loc.id,
- 'default_location_dest_id': customer_loc.id}, context=context)
+ 'default_location_dest_id': customer_loc.id,
+ 'color' : color }, context=context)
internal_picking_type_id = picking_type_obj.create(cr, uid, vals={
'name': _('Internal Transfers'),
'warehouse_id': new_id,
@@ -391,7 +404,8 @@ class stock_warehouse(osv.osv):
'sequence_id': internal_seq_id,
'default_location_src_id': wh_stock_loc.id,
'default_location_dest_id': wh_stock_loc.id,
- 'pack': True,}, context=context)
+ 'pack': True,
+ 'color' : color }, context=context)
#create routes and push/pull rules
default_route_id = self.create_route(cr, uid, new_id, warehouse, context=context)
diff --git a/addons/stock_multi_warehouse/stock_multi_warehouse.yml b/addons/stock_multi_warehouse/stock_multi_warehouse.yml
index 38b6083bd02..37f7d5ed367 100644
--- a/addons/stock_multi_warehouse/stock_multi_warehouse.yml
+++ b/addons/stock_multi_warehouse/stock_multi_warehouse.yml
@@ -41,6 +41,7 @@
code: 'WH1'
reception_steps: 'three_steps'
delivery_steps: 'pick_pack_ship'
+
-
Create WH2 warehouse in Dubai and configure it
-
diff --git a/addons/stock_picking_wave/__openerp__.py b/addons/stock_picking_wave/__openerp__.py
index 15de1fe308d..d024c1af168 100644
--- a/addons/stock_picking_wave/__openerp__.py
+++ b/addons/stock_picking_wave/__openerp__.py
@@ -33,11 +33,14 @@ This module adds the picking wave option in warehouse management.
'data': ['security/ir.model.access.csv',
'stock_picking_wave_view.xml',
'stock_picking_wave_sequence.xml',
- 'wizard/picking_to_wave_view.xml',
+ 'wizard/picking_to_wave_view.xml',
],
'demo': [
'stock_picking_wave_demo.xml',
],
+ 'css': [
+ 'static/src/css/test.css',
+ ],
'installable': True,
'auto_install': False,
diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py
index 7456995cffc..33148cac6f0 100644
--- a/addons/stock_picking_wave/stock_picking_wave.py
+++ b/addons/stock_picking_wave/stock_picking_wave.py
@@ -14,7 +14,6 @@ class stock_picking_wave(osv.osv):
'capacity_uom': fields.many2one('product.uom', 'Unit of Measure', help='The Unity Of Measure of the transport capacity'),
'wave_type_id': fields.many2one('stock.picking.wave.type', 'Picking Wave Type'),
'state': fields.selection([('in_progress', 'Running'), ('done', 'Done'), ('cancel', 'Cancelled')], required=True),
-
}
_defaults = {
From f900c908f230f1e9577eee3d5ee2c61930fcdcff Mon Sep 17 00:00:00 2001
From: jke-openerp
Date: Thu, 3 Oct 2013 15:36:28 +0200
Subject: [PATCH 7/7] continue WMS usability - add file missing
bzr revid: jke@openerp.com-20131003133628-3xxl068cmux51u76
---
.../stock_picking_wave_demo.xml | 149 ++++++++++++++++++
1 file changed, 149 insertions(+)
create mode 100644 addons/stock_picking_wave/stock_picking_wave_demo.xml
diff --git a/addons/stock_picking_wave/stock_picking_wave_demo.xml b/addons/stock_picking_wave/stock_picking_wave_demo.xml
new file mode 100644
index 00000000000..ffcdeb4462c
--- /dev/null
+++ b/addons/stock_picking_wave/stock_picking_wave_demo.xml
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+ Type Freeze
+
+
+
+ Type Dry
+
+
+
+
+ Picking Dry for John
+ 15
+
+ in_progress
+
+
+
+
+
+ Picking Freeze for Mickael
+ 600
+
+ in_progress
+
+
+
+
+
+
+ Picking #1
+ one
+ 2
+
+
+
+
+ Picking #2
+ one
+ assigned
+ 1
+
+
+
+
+ Picking #3
+ one
+ assigned
+ 1
+
+
+
+
+
+
+
+
+ Ice Cream
+
+
+
+ Dry
+
+
+
+ Ice Cream Chocolate
+ IC-CHOCO
+
+ 450.0
+ 300.0
+ consu
+
+
+ Ice Cream Chocolate with stucks
+
+
+ Ice Cream Vanilla
+ IC-VANI
+
+ 450.0
+ 300.0
+ consu
+
+
+ Ice Cream Vanilla
+
+
+ Speculoos
+ DRY-SPEC
+
+ 150.0
+ 100.0
+ consu
+
+
+ Speculoos - A belgian speciality
+
+
+
+
+
+
+ A first stock move
+
+
+
+
+
+
+
+ A second stock move
+
+
+
+
+
+
+
+ A third stock move
+
+
+
+
+
+
+
+
+ A fourth stock move
+
+
+
+
+
+
+
+
+