[IMP] procurement,stock_location: improve module description + some code cleanup in procurement wkf

bzr revid: odo@openerp.com-20101006161234-sm86b86v584u0rpq
This commit is contained in:
Olivier Dony 2010-10-06 18:12:34 +02:00
parent c750ac729b
commit 4ab62afb16
3 changed files with 50 additions and 27 deletions

View File

@ -157,34 +157,19 @@ class procurement_order(osv.osv):
""" Checks product type.
@return: True or False
"""
for procurement in self.browse(cr, uid, ids):
if procurement.product_id.type in ('product', 'consu'):
return True
return False
return all(procurement.product_id.type in ('product', 'consu') for procurement in self.browse(cr, uid, ids))
def check_move_cancel(self, cr, uid, ids, context={}):
""" Checks if move is cancelled or not.
@return: True or False.
"""
res = True
ok = False
for procurement in self.browse(cr, uid, ids, context):
if procurement.move_id:
ok = True
if not procurement.move_id.state == 'cancel':
res = False
return res and ok
return all(procurement.move_id.state != 'cancel' for procurement in self.browse(cr, uid, ids))
def check_move_done(self, cr, uid, ids, context={}):
""" Checks if move is done or not.
@return: True or False.
"""
res = True
for proc in self.browse(cr, uid, ids, context):
if proc.move_id:
if not proc.move_id.state == 'done':
res = False
return res
return all(procurement.move_id.state == 'done' for procurement in self.browse(cr, uid, ids))
#
# This method may be overrided by objects that override procurement.order

View File

@ -21,20 +21,59 @@
{
'name': 'Stock Location Paths',
'name': 'Warehouse Locations Paths',
'version': '1.0',
'category': 'Generic Modules/Inventory Control',
'description': """
Manages product's path in locations.
This module supplements the Warehouse application by adding support for per-product
location paths, effectively implementing Push and Pull inventory flows.
This module may be useful for different purposes:
* Manages the product in his whole manufacturing chain
* Manages different default locations by products
* Define paths within the warehouse to route products based on operations:
Typically this could be used to:
* Manage product manufacturing chains
* Manage default locations per product
* Define routes within your warehouse according to business needs, such as:
- Quality Control
- After Sales Services
- Supplier Return
* Manage products to be rent.
- Supplier Returns
* Help rental management, by generating automated return moves for rented products
Once this module is installed, an additional tab appear on the product form, where you can add
Push and Pull flow specifications.
Push flows
----------
Push flows are useful when the arrival of certain products in a given location should always
be followed by a corresponding move to another location, optionally after a certain delay.
The original Warehouse application already supports such Push flow specifications on the
Locations themselves, but these cannot be refined per-product.
A push flow specification indicates which location is chained with which location, and with
what parameters. As soon as a given quantity of products is moved in the source location,
a chained move is automatically foreseen according to the parameters set on the flow specification
(destination location, delay, type of move, journal, etc.) The new move can be automatically
processed, or require a manual confirmation, depending on the parameters.
Pull flows
----------
Pull flows are a bit different from Pull flows, in the sense that they are not related to
the processing of product moves, but rather to the processing of procurement orders.
What is being pulled is a need, not directly products.
A classical example of Push flow is when you have an Outlet company, with a parent Company
that is responsible for the supplies of the Outlet.
[ Customer ] <- A - [ Outlet ] <- B - [ Holding ] <~ C ~ [ Supplier ]
When a new procurement order (A, coming from the confirmation of a Sale Order for example) arrives
in the Outlet, it is converted into another procurement (B, via a Push flow of type 'move')
requested from the Holding. When procurement order B is processed by the Holding company, and
if the product is out of stock, it can be converted into a Purchase Order (C) from the Supplier
(Push flow of type Purchase). The result is that the procurement order, the need, is pushed
all the way between the Customer and Supplier.
Technically, Pull flows allow to process procurement orders differently, not only depending on
the product being considered, but also depending on which location holds the "need" for that
product (i.e. the destination location of that procurement order).
""",
'author': 'OpenERP SA',
'depends': ['procurement','stock'],

View File

@ -32,7 +32,6 @@ class procurement_order(osv.osv):
def check_buy(self, cr, uid, ids, context=None):
for procurement in self.browse(cr, uid, ids):
for line in procurement.product_id.flow_pull_ids:
if line.location_id==procurement.location_id:
return line.type_proc=='buy'
return super(procurement_order, self).check_buy(cr, uid, ids)