Commit d080ece4 authored by Aurel's avatar Aurel

compute inventory only when delivered because we must required some

properties to be set before computing stock, otherwise we can run
sql request with no condition and overload mysql


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17794 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d7346302
...@@ -97,6 +97,12 @@ class Inventory(Delivery): ...@@ -97,6 +97,12 @@ class Inventory(Delivery):
to have our own temp object constructor, this is usefull if we to have our own temp object constructor, this is usefull if we
want to use some classes with some particular methods want to use some classes with some particular methods
""" """
if self.getSimulationState() != "delivered":
# this prevent from trying to calculate stock
# with not all properties defined and thus making
# request with no condition in mysql
return
sql_catalog_id = kw.pop("sql_catalog_id", None) sql_catalog_id = kw.pop("sql_catalog_id", None)
disable_archive = kw.pop("disable_archive", 0) disable_archive = kw.pop("disable_archive", 0)
connection_id = None connection_id = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment