[MERGE] jke branch with fixes, improvement of warehouse config...
bzr revid: qdp-launchpad@openerp.com-20131028084702-j0e5c8i4df84zsfy
This commit is contained in:
commit
171c086414
|
@ -58,6 +58,7 @@ Dashboard / Reports for MRP will include:
|
|||
'security/ir.model.access.csv',
|
||||
'mrp_workflow.xml',
|
||||
'mrp_data.xml',
|
||||
'mrp_stock_data.yml',
|
||||
'wizard/mrp_product_produce_view.xml',
|
||||
'wizard/change_production_qty_view.xml',
|
||||
'wizard/mrp_price_view.xml',
|
||||
|
|
|
@ -36,12 +36,5 @@ This application supports complete integration and production scheduling for sto
|
|||
<field name="sequence">5</field>
|
||||
</record>
|
||||
|
||||
<record id="procurement_rule_supply_stock" model="procurement.rule">
|
||||
<field name="name">Manufacture to stock</field>
|
||||
<field name="action">manufacture</field>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="picking_type_id" ref="stock.picking_type_in"/>
|
||||
<field name="route_id" ref="route_warehouse0_manufacture"/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
-
|
||||
Enable the manufacturing in warehouse0
|
||||
-
|
||||
!python {model: stock.warehouse}: |
|
||||
main_warehouse = self.browse(cr, uid, ref('stock.warehouse0'), context=context)
|
||||
self.write(cr, uid, main_warehouse.id, {'manufacture_to_resupply': True}, context=context)
|
||||
|
|
@ -1028,5 +1028,16 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_warehouse_inherited" model="ir.ui.view">
|
||||
<field name="name">Stock Warehouse Inherited</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='default_resupply_wh_id']" position="before">
|
||||
<field name="manufacture_to_resupply" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
from openerp.osv import fields
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.translate import _
|
||||
|
||||
|
||||
class StockMove(osv.osv):
|
||||
|
@ -163,7 +164,6 @@ class StockPicking(osv.osv):
|
|||
return list(set(todo))
|
||||
|
||||
|
||||
|
||||
class split_in_production_lot(osv.osv_memory):
|
||||
_inherit = "stock.move.split"
|
||||
|
||||
|
@ -179,4 +179,73 @@ class split_in_production_lot(osv.osv_memory):
|
|||
return new_moves
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
class stock_warehouse(osv.osv):
|
||||
_inherit = 'stock.warehouse'
|
||||
_columns = {
|
||||
'manufacture_to_resupply': fields.boolean('Manufacture in this Warehouse'),
|
||||
'manufacture_pull_id': fields.many2one('procurement.rule', 'Manufacture Rule'),
|
||||
}
|
||||
|
||||
def _get_manufacture_pull_rule(self, cr, uid, warehouse, context=None):
|
||||
route_obj = self.pool.get('stock.location.route')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
try:
|
||||
manufacture_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_manufacture')[1]
|
||||
except:
|
||||
manufacture_route_id = route_obj.search(cr, uid, [('name', 'like', _('Manufacture'))], context=context)
|
||||
manufacture_route_id = manufacture_route_id and manufacture_route_id[0] or False
|
||||
if not manufacture_route_id:
|
||||
raise osv.except_osv(_('Error!'), _('Can\'t find any generic Manufacture route.'))
|
||||
|
||||
return {
|
||||
'name': self._format_routename(cr, uid, warehouse, _(' Manufacture'), context=context),
|
||||
'location_id': warehouse.lot_stock_id.id,
|
||||
'route_id': manufacture_route_id,
|
||||
'action': 'manufacture',
|
||||
'picking_type_id': warehouse.int_type_id.id,
|
||||
'procure_method': 'make_to_order',
|
||||
'warehouse_id': warehouse.id,
|
||||
}
|
||||
|
||||
def create_routes(self, cr, uid, ids, warehouse, context=None):
|
||||
pull_obj = self.pool.get('procurement.rule')
|
||||
res = super(stock_warehouse, self).create_routes(cr, uid, ids, warehouse, context=context)
|
||||
if warehouse.manufacture_to_resupply:
|
||||
manufacture_pull_vals = self._get_manufacture_pull_rule(cr, uid, warehouse, context=context)
|
||||
manufacture_pull_id = pull_obj.create(cr, uid, manufacture_pull_vals, context=context)
|
||||
res['manufacture_pull_id'] = manufacture_pull_id
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
pull_obj = self.pool.get('procurement.rule')
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
||||
if 'manufacture_to_resupply' in vals:
|
||||
if vals.get("manufacture_to_resupply"):
|
||||
for warehouse in self.browse(cr, uid, ids, context=context):
|
||||
if not warehouse.manufacture_pull_id:
|
||||
manufacture_pull_vals = self._get_manufacture_pull_rule(cr, uid, warehouse, context=context)
|
||||
manufacture_pull_id = pull_obj.create(cr, uid, manufacture_pull_vals, context=context)
|
||||
vals['manufacture_pull_id'] = manufacture_pull_id
|
||||
else:
|
||||
for warehouse in self.browse(cr, uid, ids, context=context):
|
||||
if warehouse.manufacture_pull_id:
|
||||
pull_obj.unlink(cr, uid, warehouse.manufacture_pull_id.id, context=context)
|
||||
return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None)
|
||||
|
||||
def get_all_routes_for_wh(self, cr, uid, warehouse, context=None):
|
||||
all_routes = super(stock_warehouse, self).get_all_routes_for_wh(cr, uid, warehouse, context=context)
|
||||
if warehouse.manufacture_to_resupply and warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id:
|
||||
all_routes += [warehouse.manufacture_pull_id.route_id.id]
|
||||
return all_routes
|
||||
|
||||
def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None):
|
||||
res = super(stock_warehouse, self)._get_all_products_to_resupply(cr, uid, warehouse, context=context)
|
||||
if warehouse.manufacture_pull_id and warehouse.manufacture_pull_id.route_id:
|
||||
for product_id in res:
|
||||
for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids:
|
||||
if route.id == warehouse.manufacture_pull_id.route_id.id:
|
||||
res.remove(product_id)
|
||||
break
|
||||
return res
|
||||
|
|
|
@ -54,6 +54,7 @@ Dashboard / Reports for Purchase Management will include:
|
|||
'purchase_sequence.xml',
|
||||
'company_view.xml',
|
||||
'purchase_data.xml',
|
||||
'purchase_data.yml',
|
||||
'wizard/purchase_order_group_view.xml',
|
||||
'wizard/purchase_line_invoice_view.xml',
|
||||
'purchase_report.xml',
|
||||
|
@ -86,6 +87,7 @@ Dashboard / Reports for Purchase Management will include:
|
|||
'demo': [
|
||||
'purchase_order_demo.yml',
|
||||
'purchase_demo.xml',
|
||||
'purchase_stock_demo.yml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
|
|
|
@ -42,12 +42,6 @@
|
|||
<field name="fields_id" search="[('model','=','res.partner'),('name','=','property_product_pricelist_purchase')]"/>
|
||||
<field eval="'product.pricelist,'+str(list0)" name="value"/>
|
||||
</record>
|
||||
|
||||
<function
|
||||
eval="('default',False,'picking_type_id', [('purchase.order', False)], ref('stock.picking_type_in'), True, False, False, False, True)"
|
||||
id="purchase_default_set"
|
||||
model="ir.values"
|
||||
name="set"/>
|
||||
|
||||
<!-- Purchase-related subtypes for messaging / Chatter -->
|
||||
<record id="mt_rfq_confirmed" model="mail.message.subtype">
|
||||
|
@ -76,13 +70,6 @@
|
|||
</record>
|
||||
|
||||
<!-- TODO: use a yaml file with python code to enable purcahse on main warehouse, so that the location_id is correct -->
|
||||
<record id="procurement_rule_supply_stock" model="procurement.rule">
|
||||
<field name="name">WH: Buy</field>
|
||||
<field name="action">buy</field>
|
||||
<field name="location_id" ref="stock.stock_location_stock"/>
|
||||
<field name="picking_type_id" ref="stock.picking_type_in"/>
|
||||
<field name="route_id" ref="route_warehouse0_buy"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
-
|
||||
!python {model: ir.values, id: purchase_default_set}: |
|
||||
whr = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock.warehouse0'), context=context)
|
||||
self.set_default(cr, uid, 'purchase.order', 'picking_type_id', whr.in_type_id.id, for_all_users=True, company_id=True, condition=False)
|
||||
-
|
||||
!python {model: stock.warehouse}: |
|
||||
main_warehouse = self.browse(cr, uid, ref('stock.warehouse0'), context=context)
|
||||
#Force the rewriting of route and rule
|
||||
self.write(cr, uid, main_warehouse.id, {'buy_to_resupply': True}, context=context)
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
-
|
||||
!python {model: stock.warehouse}: |
|
||||
pull_obj = self.pool.get('procurement.rule')
|
||||
wh_to_assign = ['stock_warehouse_shop0','stock_warehouse_shop1','warehouse_icecream']
|
||||
for wh_ref in wh_to_assign:
|
||||
warehouse = self.browse(cr, uid, ref('stock.' + wh_ref), context=context)
|
||||
#Force the rewriting of route and rule
|
||||
self.write(cr, uid, warehouse.id, {'buy_to_resupply': True}, context=context)
|
||||
|
||||
|
||||
|
||||
|
|
@ -20,7 +20,8 @@
|
|||
##############################################################################
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp import netsvc
|
||||
from openerp.tools.translate import _
|
||||
|
||||
class stock_move(osv.osv):
|
||||
_inherit = 'stock.move'
|
||||
_columns = {
|
||||
|
@ -72,3 +73,83 @@ class stock_picking(osv.osv):
|
|||
# Here is how it should work:
|
||||
# On a draft invoice, allows to select purchase_orders (many2many_tags)
|
||||
# This fills in automatically PO lines or from related receptions if any
|
||||
|
||||
class stock_warehouse(osv.osv):
|
||||
_inherit = 'stock.warehouse'
|
||||
_columns = {
|
||||
'buy_to_resupply': fields.boolean('Purchase to resupply this warehouse'),
|
||||
'buy_pull_id': fields.many2one('procurement.rule', 'BUY rule'),
|
||||
}
|
||||
_defaults = {
|
||||
'buy_to_resupply': True,
|
||||
}
|
||||
|
||||
def _get_buy_pull_rule(self, cr, uid, warehouse, context=None):
|
||||
route_obj = self.pool.get('stock.location.route')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
try:
|
||||
buy_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_buy')[1]
|
||||
except:
|
||||
buy_route_id = route_obj.search(cr, uid, [('name', 'like', _('Buy'))], context=context)
|
||||
buy_route_id = buy_route_id and buy_route_id[0] or False
|
||||
if not buy_route_id:
|
||||
raise osv.except_osv(_('Error!'), _('Can\'t find any generic Buy route.'))
|
||||
|
||||
return {
|
||||
'name': self._format_routename(cr, uid, warehouse, _(' Buy'), context=context),
|
||||
'location_id': warehouse.in_type_id.default_location_dest_id.id,
|
||||
'route_id': buy_route_id,
|
||||
'action': 'buy',
|
||||
'picking_type_id': warehouse.in_type_id.id,
|
||||
'procure_method': 'make_to_order',
|
||||
'warehouse_id': warehouse.id,
|
||||
}
|
||||
|
||||
def create_routes(self, cr, uid, ids, warehouse, context=None):
|
||||
pull_obj = self.pool.get('procurement.rule')
|
||||
res = super(stock_warehouse, self).create_routes(cr, uid, ids, warehouse, context=context)
|
||||
if warehouse.buy_to_resupply:
|
||||
buy_pull_vals = self._get_buy_pull_rule(cr, uid, warehouse, context=context)
|
||||
buy_pull_id = pull_obj.create(cr, uid, buy_pull_vals, context=context)
|
||||
res['buy_pull_id'] = buy_pull_id
|
||||
return res
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
pull_obj = self.pool.get('procurement.rule')
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
|
||||
if 'buy_to_resupply' in vals:
|
||||
if vals.get("buy_to_resupply"):
|
||||
for warehouse in self.browse(cr, uid, ids, context=context):
|
||||
if not warehouse.buy_pull_id:
|
||||
buy_pull_vals = self._get_buy_pull_rule(cr, uid, warehouse, context=context)
|
||||
buy_pull_id = pull_obj.create(cr, uid, buy_pull_vals, context=context)
|
||||
vals['buy_pull_id'] = buy_pull_id
|
||||
else:
|
||||
for warehouse in self.browse(cr, uid, ids, context=context):
|
||||
if warehouse.buy_pull_id:
|
||||
buy_pull_id = pull_obj.unlink(cr, uid, warehouse.buy_pull_id.id, context=context)
|
||||
return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None)
|
||||
|
||||
def get_all_routes_for_wh(self, cr, uid, warehouse, context=None):
|
||||
all_routes = super(stock_warehouse, self).get_all_routes_for_wh(cr, uid, warehouse, context=context)
|
||||
if warehouse.buy_to_resupply and warehouse.buy_pull_id and warehouse.buy_pull_id.route_id:
|
||||
all_routes += [warehouse.buy_pull_id.route_id.id]
|
||||
return all_routes
|
||||
|
||||
def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None):
|
||||
res = super(stock_warehouse, self)._get_all_products_to_resupply(cr, uid, warehouse, context=context)
|
||||
if warehouse.buy_pull_id and warehouse.buy_pull_id.route_id:
|
||||
for product_id in res:
|
||||
for route in self.pool.get('product.product').browse(cr, uid, product_id, context=context).route_ids:
|
||||
if route.id == warehouse.buy_pull_id.route_id.id:
|
||||
res.remove(product_id)
|
||||
break
|
||||
return res
|
||||
|
||||
def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None):
|
||||
res = super(stock_warehouse, self).change_route(cr, uid, ids, warehouse, new_reception_step=new_reception_step, new_delivery_step=new_delivery_step, context=context)
|
||||
if warehouse.in_type_id.default_location_dest_id != warehouse.buy_pull_id.location_id:
|
||||
self.pool.get('procurement.rule').write(cr, uid, warehouse.buy_pull_id.id, {'location_id': warehouse.in_type_id.default_location_dest_id.id}, context=context)
|
||||
return res
|
||||
|
|
|
@ -40,6 +40,17 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_warehouse_inherited" model="ir.ui.view">
|
||||
<field name="name">Stock Warehouse Inherited</field>
|
||||
<field name="model">stock.warehouse</field>
|
||||
<field name="inherit_id" ref="stock.view_warehouse"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='default_resupply_wh_id']" position="before">
|
||||
<field name="buy_to_resupply" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_picking_tree_picking_to_invoice" model="ir.actions.act_window">
|
||||
<field name="name">On Incoming Shipments</field>
|
||||
|
|
|
@ -137,7 +137,7 @@ class procurement_order(osv.osv):
|
|||
pull_obj = self.pool.get('procurement.rule')
|
||||
warehouse_route_ids = []
|
||||
if procurement.warehouse_id:
|
||||
domain += [('warehouse_id', '=', procurement.warehouse_id.id)]
|
||||
domain += ['|', ('warehouse_id', '=', procurement.warehouse_id.id), ('warehouse_id', '=', False)]
|
||||
warehouse_route_ids = [x.id for x in procurement.warehouse_id.route_ids]
|
||||
product_route_ids = [x.id for x in procurement.product_id.route_ids + procurement.product_id.categ_id.total_route_ids]
|
||||
procurement_route_ids = [x.id for x in procurement.route_ids]
|
||||
|
|
|
@ -46,7 +46,7 @@ counter-parts locations) and a very simple user interface.
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Barcode Scanner UI</h2>
|
||||
<h3 class="oe_slogan">Barcode scanner user interface</h3>
|
||||
|
@ -80,7 +80,7 @@ Optimizes the planning and jobs with the scheduler to reduce your process time.
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Get Full Traceability</h2>
|
||||
<div class="oe_span6">
|
||||
|
@ -122,7 +122,7 @@ system help you with fullfilment propositions.
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Fully Integrated with Operations</h2>
|
||||
<h3 class="oe_slogan">Sales, Purchases and Accounting integration</h3>
|
||||
|
@ -160,7 +160,7 @@ OpenERP handles unique serial numbers, batches of identical products or packagin
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Scale Your WMS easily</h2>
|
||||
<div class="oe_span6">
|
||||
|
@ -198,7 +198,114 @@ real-time reports that anyone can create and share.
|
|||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Use Routes to Support Your Own Delivery Process</h2>
|
||||
<h3 class="oe_slogan">Define routes according to your warehouse organization</h3>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Customize routes and picking/packing operations to support your own customer
|
||||
delivery process. Define custom routes or use pre-configured routes, e.g.: pick
|
||||
⇨ pack ⇨ ship.
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img oe_centered">
|
||||
<img class="oe_picture" src="warehouse_illu_02.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Wave & Batch Picking</h2>
|
||||
<h3 class="oe_slogan">Optimize your picking orders</h3>
|
||||
<div class="oe_span6">
|
||||
<img class="oe_picture oe_screenshot" src="stock_calendar.png">
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Use routes, waves and orderpoint rules to optimize the way you pick products in
|
||||
the warehouse. OpenERP supports most picking methods out-of-the-box like; wave
|
||||
picking, batch picking and "by order" picking.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Cross-Docking some products</h2>
|
||||
<h3 class="oe_slogan">Streamline your supply chain from point of origin to point of sale</h3>
|
||||
<div class="oe_span6">
|
||||
<img class="oe_picture oe_screenshot" src="stock_calendar.png">
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Unload incoming materials from suppliers and route them directly to the packing
|
||||
or delivery zone to deliver customers, without going through the stock. Set the
|
||||
"Cross-Dock" route on products or per sale order lines.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Make to Order and Dropshipping On Demand</h2>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Fulfill sales order by purchasing or manufacturing products on demand, with the
|
||||
"Make to Order" route. Use the dropshipping route to deliver customers directly
|
||||
from your suppliers.
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<img class="oe_picture oe_screenshot" src="stock_procurement.png">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Advanced Removal Strategies</h2>
|
||||
<h3 class="oe_slogan">Optimize your material turnover</h3>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_bg_img">
|
||||
<img class="oe_picture" src="stock_product_form.png">
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Setup removal strategies per location and/or categories of products. Use
|
||||
pre-defined strategies (e.g. FIFO, LIFO, FEFO) or easily implement your
|
||||
specific ones to optimize the material turnover.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<h2 class="oe_slogan">Put Away Strategies</h2>
|
||||
<h3 class="oe_slogan">Optimize storage space with smart strategies</h3>
|
||||
<div class="oe_span6">
|
||||
<p class='oe_mt32'>
|
||||
Setup put away strategies to optimize product storage and bin allocations. Just
|
||||
define strategies per location, product category and product to store
|
||||
efficiently incoming materials.
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_row_img oe_centered">
|
||||
<img class="oe_picture" src="warehouse_illu_01.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Many companies already enjoy it</h2>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
|
@ -2004,7 +2004,7 @@ class stock_inventory(osv.osv):
|
|||
'location_id': _default_stock_location,
|
||||
}
|
||||
|
||||
def set_checked_qty(self , cr ,uid ,ids ,context=None):
|
||||
def set_checked_qty(self, cr, uid, ids, context=None):
|
||||
inventory = self.browse(cr, uid, ids[0], context=context)
|
||||
line_ids = [line.id for line in inventory.line_ids]
|
||||
self.pool.get('stock.inventory.line').write(cr, uid, line_ids, {'product_qty': 0})
|
||||
|
@ -2144,7 +2144,7 @@ class stock_inventory(osv.osv):
|
|||
for product_line in cr.dictfetchall():
|
||||
#replace the None the dictionary by False, because falsy values are tested later on
|
||||
for key, value in product_line.items():
|
||||
if value == None:
|
||||
if not value:
|
||||
product_line[key] = False
|
||||
product_line['inventory_id'] = inventory.id
|
||||
product_line['th_qty'] = product_line['product_qty']
|
||||
|
@ -2211,7 +2211,7 @@ class stock_inventory_line(osv.osv):
|
|||
if not product:
|
||||
return {'value': {'product_qty': 0.0, 'product_uom_id': False}}
|
||||
uom_obj = self.pool.get('product.uom')
|
||||
ctx=context.copy()
|
||||
ctx = context.copy()
|
||||
ctx['location'] = location_id
|
||||
ctx['lot_id'] = lot_id
|
||||
ctx['owner_id'] = owner_id
|
||||
|
@ -2230,6 +2230,7 @@ class stock_inventory_line(osv.osv):
|
|||
class stock_warehouse(osv.osv):
|
||||
_name = "stock.warehouse"
|
||||
_description = "Warehouse"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=128, required=True, select=True),
|
||||
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
|
||||
|
@ -2265,6 +2266,12 @@ class stock_warehouse(osv.osv):
|
|||
'default_resupply_wh_id': fields.many2one('stock.warehouse', 'Default Resupply Warehouse'),
|
||||
}
|
||||
|
||||
def onchange_filter_default_resupply_wh_id(self, cr, uid, ids, default_resupply_wh_id, resupply_wh_ids, context=None):
|
||||
resupply_wh_ids = set([x['id'] for x in (self.resolve_2many_commands(cr, uid, 'resupply_wh_ids', resupply_wh_ids, ['id']))])
|
||||
resupply_wh_ids.add(default_resupply_wh_id)
|
||||
resupply_wh_ids = list(resupply_wh_ids)
|
||||
return {'value': {'resupply_wh_ids': resupply_wh_ids}}
|
||||
|
||||
def _get_inter_wh_location(self, cr, uid, warehouse, context=None):
|
||||
''' returns a tuple made of the browse record of customer location and the browse record of supplier location'''
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
@ -2319,7 +2326,7 @@ class stock_warehouse(osv.osv):
|
|||
def _default_stock_id(self, cr, uid, context=None):
|
||||
#lot_input_stock = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
|
||||
try:
|
||||
warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0')
|
||||
warehouse = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'warehouse0')
|
||||
return warehouse.lot_stock_id.id
|
||||
except:
|
||||
return False
|
||||
|
@ -2331,8 +2338,9 @@ class stock_warehouse(osv.osv):
|
|||
'delivery_steps': 'ship_only',
|
||||
}
|
||||
_sql_constraints = [
|
||||
('warehouse_name_uniq', 'unique (name, company_id)', 'The name of the warehouse must be unique per company!'),
|
||||
('warehouse_code_uniq', 'unique (code, company_id)', 'The code of the warehouse must be unique per company !'),
|
||||
('warehouse_name_uniq', 'unique(name, company_id)', 'The name of the warehouse must be unique per company!'),
|
||||
('warehouse_code_uniq', 'unique(code, company_id)', 'The code of the warehouse must be unique per company!'),
|
||||
('default_resupply_wh_diff', 'check (id != default_resupply_wh_id)', 'The default resupply warehouse should be different that the warehouse itself!'),
|
||||
]
|
||||
|
||||
def _get_partner_locations(self, cr, uid, ids, context=None):
|
||||
|
@ -2409,6 +2417,7 @@ class stock_warehouse(osv.osv):
|
|||
return push_rules_list, pull_rules_list
|
||||
|
||||
def _get_mto_pull_rule(self, cr, uid, warehouse, values, context=None):
|
||||
route_obj = self.pool.get('stock.location.route')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
try:
|
||||
mto_route_id = data_obj.get_object_reference(cr, uid, 'stock', 'route_warehouse0_mto')[1]
|
||||
|
@ -2457,7 +2466,7 @@ class stock_warehouse(osv.osv):
|
|||
for push_rule in push_rules_list:
|
||||
push_obj.create(cr, uid, vals=push_rule, context=context)
|
||||
for pull_rule in pull_rules_list:
|
||||
#all pull rules in reception route are mto, because we don't won't to wait for the scheduler to trigger an orderpoint on input location
|
||||
#all pull rules in reception route are mto, because we don't want to wait for the scheduler to trigger an orderpoint on input location
|
||||
pull_rule['procure_method'] = 'make_to_order'
|
||||
pull_obj.create(cr, uid, vals=pull_rule, context=context)
|
||||
|
||||
|
@ -2486,14 +2495,14 @@ class stock_warehouse(osv.osv):
|
|||
#create route selectable on the product to resupply the warehouse from another one
|
||||
self._create_resupply_routes(cr, uid, warehouse, warehouse.resupply_wh_ids, warehouse.default_resupply_wh_id, context=context)
|
||||
|
||||
#set routes and mto pull rule on warehouse
|
||||
return self.write(cr, uid, warehouse.id, {
|
||||
#return routes and mto pull rule for warehouse
|
||||
return {
|
||||
'route_ids': wh_route_ids,
|
||||
'mto_pull_id': mto_pull_id,
|
||||
'reception_route_id': reception_route_id,
|
||||
'delivery_route_id': delivery_route_id,
|
||||
'crossdock_route_id': crossdock_route_id,
|
||||
}, context=context)
|
||||
}
|
||||
|
||||
def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None):
|
||||
picking_type_obj = self.pool.get('stock.picking.type')
|
||||
|
@ -2536,6 +2545,8 @@ class stock_warehouse(osv.osv):
|
|||
for push_rule in push_rules_list:
|
||||
push_obj.create(cr, uid, vals=push_rule, context=context)
|
||||
for pull_rule in pull_rules_list:
|
||||
#all pull rules in reception route are mto, because we don't want to wait for the scheduler to trigger an orderpoint on input location
|
||||
pull_rule['procure_method'] = 'make_to_order'
|
||||
pull_obj.create(cr, uid, vals=pull_rule, context=context)
|
||||
|
||||
route_obj.write(cr, uid, warehouse.crossdock_route_id.id, {'active': new_reception_step != 'one_step' and new_delivery_step != 'ship_only'}, context=context)
|
||||
|
@ -2677,7 +2688,8 @@ class stock_warehouse(osv.osv):
|
|||
warehouse.refresh()
|
||||
|
||||
#create routes and push/pull rules
|
||||
self.create_routes(cr, uid, new_id, warehouse, context=context)
|
||||
new_objects_dict = self.create_routes(cr, uid, new_id, warehouse, context=context)
|
||||
self.write(cr, uid, warehouse.id, new_objects_dict, context=context)
|
||||
return new_id
|
||||
|
||||
def _format_rulename(self, cr, uid, obj, from_loc, dest_loc, context=None):
|
||||
|
@ -2705,8 +2717,6 @@ class stock_warehouse(osv.osv):
|
|||
context = {}
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
if context is None:
|
||||
context = {}
|
||||
seq_obj = self.pool.get('ir.sequence')
|
||||
location_obj = self.pool.get('stock.location')
|
||||
route_obj = self.pool.get('stock.location.route')
|
||||
|
@ -2778,7 +2788,7 @@ class stock_warehouse(osv.osv):
|
|||
return super(stock_warehouse, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def get_all_routes_for_wh(self, cr, uid, warehouse, context=None):
|
||||
all_routes = []
|
||||
all_routes = []
|
||||
all_routes += [warehouse.crossdock_route_id.id]
|
||||
all_routes += [warehouse.reception_route_id.id]
|
||||
all_routes += [warehouse.delivery_route_id.id]
|
||||
|
@ -2791,8 +2801,7 @@ class stock_warehouse(osv.osv):
|
|||
all_routes = []
|
||||
for wh in self.browse(cr, uid, ids, context=context):
|
||||
all_routes += self.get_all_routes_for_wh(cr, uid, wh, context=context)
|
||||
|
||||
res_id = ids and ids[0] or False
|
||||
|
||||
domain = [('id', 'in', all_routes)]
|
||||
return {
|
||||
'name': _('Warehouse\'s Routes'),
|
||||
|
|
|
@ -1,139 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--Pick / Pack / Input location
|
||||
-->
|
||||
<!--
|
||||
<record id="location_pack_zone" model="stock.location">
|
||||
<field name="name">Packing zone</field>
|
||||
<field name="location_id" ref="company"/>
|
||||
<field name="usage">internal</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_input" model="stock.location">
|
||||
<field name="name">Input</field>
|
||||
<field name="location_id" ref="stock.stock_location_company"/>
|
||||
<field name="usage">internal</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="stock_location_quality" model="stock.location">
|
||||
<field name="name">Quality Control</field>
|
||||
<field name="location_id" ref="stock.stock_location_company"/>
|
||||
<field name="usage">internal</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
-->
|
||||
<!-- Sequences and picking types -->
|
||||
<!-- <record id="seq_picking_type_pack" model="ir.sequence">
|
||||
<field name="name">Main warehouse: Pack</field>
|
||||
<field name="prefix">WH\PACK</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
<record id="picking_type_pack" model="stock.picking.type">
|
||||
<field name="name">Pack Operations</field>
|
||||
<field name="sequence_id" ref="seq_picking_type_pack"/>
|
||||
<field name="default_location_src_id" ref="location_pack_zone"/>
|
||||
<field name="default_location_dest_id" ref="stock.stock_location_output"/>
|
||||
<field name="code_id">internal</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="seq_picking_type_pick" model="ir.sequence">
|
||||
<field name="name">Main warehouse: Pick</field>
|
||||
<field name="prefix">WH\PICK</field>
|
||||
<field name="padding">5</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="picking_type_pick" model="stock.picking.type">
|
||||
<field name="name">Pick Operations</field>
|
||||
<field name="sequence_id" ref="seq_picking_type_pick"/>
|
||||
<field name="default_location_src_id" ref="stock.stock_location_stock"/>
|
||||
<field name="default_location_dest_id" ref="location_pack_zone"/>
|
||||
<field name="code_id">internal</field>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
-->
|
||||
<!--
|
||||
Procurement rules
|
||||
--><!--
|
||||
<record id="route_warehouse0_mts" model='stock.location.route'>
|
||||
<field name="name">Your Company: Ship only</field>
|
||||
<field name="sequence">20</field>
|
||||
<field name="warehouse_selectable" eval="True"/>
|
||||
<field name="product_selectable" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="procurement_rule_customer0_mts" model="procurement.rule">
|
||||
<field name="name">Your Company: Stock → Customers</field>
|
||||
<field name="action">move</field>
|
||||
<field name="location_id" ref="stock.stock_location_customers"/>
|
||||
<field name="location_src_id" ref="stock.stock_location_stock"/>
|
||||
<field name="procure_method">make_to_stock</field>
|
||||
<field name="route_id" ref="route_warehouse0_mts"/>
|
||||
<field name="picking_type_id" ref="stock.picking_type_out"/>
|
||||
</record>
|
||||
|
||||
<record id="route_warehouse0_crossdock" model='stock.location.route'>
|
||||
<field name="name">Your Company: Cross-Dock</field>
|
||||
<field name="sequence">9</field>
|
||||
<field name="product_categ_selectable" eval="True"/>
|
||||
<field name="warehouse_selectable" eval="True"/>
|
||||
<field name="product_selectable" eval="False"/>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="procurement_rule_customer0_xdock" model="procurement.rule">
|
||||
<field name="name">Your Company: Output → Customers</field>
|
||||
<field name="action">move</field>
|
||||
<field name="location_id" ref="stock.stock_location_customers"/>
|
||||
<field name="location_src_id" ref="stock.stock_location_output"/>
|
||||
<field name="procure_method">make_to_order</field>
|
||||
<field name="route_id" ref="route_warehouse0_crossdock"/>
|
||||
<field name="picking_type_id" ref="stock.picking_type_out"/>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="procurement_rule_customer0_xdock_start" model="procurement.rule">
|
||||
<field name="name">Your Company: Input → Output</field>
|
||||
<field name="action">move</field>
|
||||
<field name="location_id" ref="stock.stock_location_output"/>
|
||||
<field name="location_src_id" ref="stock_location_input"/>
|
||||
<field name="procure_method">make_to_stock</field>
|
||||
<field name="route_id" ref="route_warehouse0_crossdock"/>
|
||||
<field name="picking_type_id" ref="stock.picking_type_internal"/>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
-->
|
||||
<!-- reception route -->
|
||||
<!-- <record id="route_1_push" model='stock.location.route'>
|
||||
<field name="name">1-step Receival</field>
|
||||
<field name="sequence">20</field>
|
||||
<field name="product_categ_selectable" eval="True"/>
|
||||
<field name="product_selectable" eval="False"/>
|
||||
<field name="active" eval="False"/>
|
||||
</record>
|
||||
|
||||
<record id="stock.warehouse0" model="stock.warehouse">
|
||||
<field name="route_ids" eval="[(6, 0, [ref('route_warehouse0_crossdock'), ref('route_warehouse0_mts'), ref('route_1_push')])]"/>
|
||||
<field name="mto_pull_id" ref="stock.procurement_rule_customer_mto"/>
|
||||
<field name="wh_input_stock_loc_id" ref="stock_location_input"/>
|
||||
<field name="wh_output_stock_loc_id" ref="stock.stock_location_output"/>
|
||||
<field name="wh_qc_stock_loc_id" ref="stock_location_quality"/>
|
||||
<field name="wh_pack_stock_loc_id" ref="location_pack_zone"/>
|
||||
<field name="pick_type_id" ref="picking_type_pick"/>
|
||||
<field name="pack_type_id" ref="picking_type_pack"/>
|
||||
<field name="in_type_id" ref="stock.picking_type_in"/>
|
||||
<field name="out_type_id" ref="stock.picking_type_out"/>
|
||||
<field name="int_type_id" ref="stock.picking_type_internal"/>
|
||||
<field name="reception_route_id" ref="route_1_push"/>
|
||||
<field name="delivery_route_id" ref="route_warehouse0_mts"/>
|
||||
<field name="crossdock_route_id" ref="route_warehouse0_crossdock"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
</openerp>
|
|
@ -667,8 +667,8 @@
|
|||
<group colspan="4">
|
||||
<field name="reception_steps" widget='radio'/>
|
||||
<field name="delivery_steps" widget='radio'/>
|
||||
<field name="resupply_wh_ids" domain="[('id', '!=', id)]" widget='many2many_checkboxes'/>
|
||||
<field name="default_resupply_wh_id"/> <!-- TODO should be filtered on resupply_wh_ids only... -->
|
||||
<field name="default_resupply_wh_id" widget='selection' on_change="onchange_filter_default_resupply_wh_id(default_resupply_wh_id, resupply_wh_ids)"/>
|
||||
<field name="resupply_wh_ids" domain="[('id', '!=', id)]" widget='many2many_checkboxes' on_change="onchange_filter_default_resupply_wh_id(default_resupply_wh_id, resupply_wh_ids)"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Technical Information" groups='base.group_no_one'>
|
||||
|
|
Loading…
Reference in New Issue