Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
138
Merge Requests
138
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
6509dfad
Commit
6509dfad
authored
Mar 30, 2018
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: use flow unit for min stock calculation
parent
aba9cf68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
product/ERP5/mixin/builder.py
product/ERP5/mixin/builder.py
+9
-1
No files found.
product/ERP5/mixin/builder.py
View file @
6509dfad
...
...
@@ -299,6 +299,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
resource_value
=
supply
.
getResourceValue
()
default_quantity_unit_value
=
resource_value
.
getDefaultQuantityUnitValue
()
order_quantity_unit_value
=
supply
.
getOrderQuantityUnitValue
()
flow_quantity_unit_value
=
supply
.
getFlowQuantityUnitValue
()
time_quantity_unit_value
=
supply
.
getTimeQuantityUnitValue
()
time_second_ratio
=
resource_value
.
getQuantityUnitDefinitionRatio
(
portal
.
portal_categories
.
quantity_unit
.
time
.
second
)
min_delay
=
supply
.
getMinDelay
()
...
...
@@ -342,6 +343,13 @@ class BuilderMixin(XMLObject, Amount, Predicate):
else
:
default_quantity_unit_order_quantity_unit_conversion_ratio
=
1
if
flow_quantity_unit_value
is
not
None
:
flow_quantity_unit_relative_url
=
flow_quantity_unit_value
.
getCategoryRelativeUrl
()
flow_quantity_unit_default_quantity_unit_conversion_ratio
=
resource_value
.
convertQuantity
(
1
,
flow_quantity_unit_relative_url
,
default_quantity_unit_relative_url
)
default_quantity_unit_flow_quantity_unit_conversion_ratio
=
1
/
flow_quantity_unit_default_quantity_unit_conversion_ratio
else
:
default_quantity_unit_flow_quantity_unit_conversion_ratio
=
1
def
getPreviousValidDate
(
date
):
# We suppose the system has not been configured to handled per hour commands
return
DateTime
(
supply
.
getNextPeriodicalDate
(
...
...
@@ -453,7 +461,7 @@ class BuilderMixin(XMLObject, Amount, Predicate):
supply
=
supply
,
history_list
=
period_history_list
,
at_date
=
period_start_date
,
conversion_ratio
=
default_quantity_unit_
order
_quantity_unit_conversion_ratio
,
conversion_ratio
=
default_quantity_unit_
flow
_quantity_unit_conversion_ratio
,
)
quantity
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment