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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
99e6a04f
Commit
99e6a04f
authored
Feb 28, 2018
by
Cédric Le Ninivin
Committed by
Cédric Le Ninivin
May 29, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_pdm: Add Supply_getExpectedDateTuple script
parent
b9ed8458
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
0 deletions
+96
-0
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.py
...Item/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.py
+34
-0
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.xml
...tem/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.xml
+62
-0
No files found.
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.py
0 → 100644
View file @
99e6a04f
from
Products.ERP5Type.DateUtils
import
addToDate
supply
=
context
time_quantity_unit_value
=
supply
.
getTimeQuantityUnitValue
()
if
time_quantity_unit_value
is
None
:
return
time_second_ratio
=
float
(
context
.
getPortalObject
().
portal_categories
.
quantity_unit
.
time
.
second
.
getProperty
(
'quantity'
))
time_second_conversion_ratio
=
float
(
time_quantity_unit_value
.
getProperty
(
'quantity'
))
/
time_second_ratio
if
use_min_delay
:
delay_second
=
supply
.
getMinDelay
()
*
time_second_conversion_ratio
order_delay_second
=
supply
.
getMinOrderDelay
()
*
time_second_conversion_ratio
else
:
delay_second
=
supply
.
getMaxDelay
()
*
time_second_conversion_ratio
order_delay_second
=
supply
.
getMaxOrderDelay
()
*
time_second_conversion_ratio
if
effective_date
is
not
None
:
start_date
=
addToDate
(
effective_date
,
second
=
order_delay_second
)
stop_date
=
addToDate
(
start_date
,
second
=
delay_second
)
elif
start_date
is
not
None
:
effective_date
=
addToDate
(
start_date
,
second
=-
order_delay_second
)
stop_date
=
addToDate
(
start_date
,
second
=
delay_second
)
elif
stop_date
is
not
None
:
start_date
=
addToDate
(
stop_date
,
second
=-
delay_second
)
effective_date
=
addToDate
(
start_date
,
second
=-
order_delay_second
)
else
:
effective_date
=
DateTime
().
earliestTime
()
start_date
=
addToDate
(
effective_date
,
second
=
order_delay_second
)
stop_date
=
addToDate
(
start_date
,
second
=
delay_second
)
return
effective_date
,
start_date
,
stop_date
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Supply_getExpectedDateTuple.xml
0 → 100644
View file @
99e6a04f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
effective_date=None, start_date=None, stop_date=None, use_min_delay=True
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Supply_getExpectedDateTuple
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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