Skip to content

Commit

Permalink
spellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
gurneyalex committed Nov 29, 2013
1 parent 7bcb9b0 commit e56f9a9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
21 changes: 12 additions & 9 deletions sale_exception_nostock/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@
Sale stock exception
--------------------
This addon adds two new sales exceptions to be used by sale_exception addon.
The first one will ensure that an order line can be delivered on the delivery
$date if it is in MTS. Validation is done by using the order line location via
related shop and using the line delay.
This addon adds two new sales exceptions to be used by the `sale_exception` addon:
The second one will create a sales exception if the current SO will break a
sales order already placed in the future.
The second test will only look for stock moves that pass by the line location.
So if your stock have children or if you have configured automated stock actions
they must pass by the location related to the SO line, else they will be ignored.
* The first one ensures that an order line can be delivered on the delivery
date if it is in MTS. Validation is done by using the order line location via
related shop and using the line delay.
* The second one will create a sales exception if the current SO will break a
sales order already placed in the future.
The second test will only look for stock moves that pass by the line location,
so if your stock have children or if you have configured automated stock
actions they must pass by the location related to the SO line, else they will
be ignored.
**Warning:**
Expand Down
13 changes: 6 additions & 7 deletions sale_exception_nostock/model/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@


class sale_order_line(orm.Model):
"""Adds two exception functions to be call by sale_exceptions module.
"""Adds two exception functions to be called by the sale_exceptions module.
The first one will ensure that an order line can be delivered on the
delivery date, if the related product is in MTS. Validation is done by
using the shop related to the sales order line location and using the line
delay.
The second one will raise a sales exception if the current SO will break a
The second one will raise a sales exception if the current SO will break an
order already placed in future
"""
Expand All @@ -49,12 +49,12 @@ def _get_line_location(self, line_br, context=None):
return line_br.order_id.shop_id.warehouse_id.lot_stock_id.id

def can_command_at_delivery_date(self, cr, uid, l_id, context=None):
"""Predicate that Checks if SO line can be delivered at delivery date.
"""Predicate that checks whether a SO line can be delivered at delivery date.
Delivery date is computed using date of the order + line delay.
Location is taken from the shop linked to the line
:returns: True if line can be delivered on time
:return: True if line can be delivered on time
"""
if context is None:
Expand Down Expand Up @@ -90,7 +90,7 @@ def _get_affected_dates(self, cr, location_id, product_id, delivery_date, contex
:param location_id: location id to be checked
:param product_id: product id te be checked
:returns: list of dates to be checked
:return: list of dates to be checked
"""
sql = ("SELECT date FROM stock_move"
Expand All @@ -110,8 +110,7 @@ def future_orders_are_affected(self, cr, uid, l_id, context=None):
This can be a performance killer, you should not use it
if you have constantly a lot of running Orders
:returns: True if future order are affected by current command line
:return: True if future order are affected by current command line
"""
if context is None:
context = {}
Expand Down

0 comments on commit e56f9a9

Please sign in to comment.