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
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
b35b8d44
Commit
b35b8d44
authored
Mar 22, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into zope4py2
parents
64e9f5d8
8148bdab
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
196 deletions
+17
-196
bt5/erp5_maileva_connector/SkinTemplateItem/portal_skins/erp5_maileva_connector/MailevaSOAPConnector_getAvailableConnector.py
...a_connector/MailevaSOAPConnector_getAvailableConnector.py
+1
-0
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow.xml
...kflowTemplateItem/portal_workflow/send_state_workflow.xml
+1
-4
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_draft.xml
...eItem/portal_workflow/send_state_workflow/state_draft.xml
+2
-40
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_failed.xml
...Item/portal_workflow/send_state_workflow/state_failed.xml
+2
-40
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_sending.xml
...tem/portal_workflow/send_state_workflow/state_sending.xml
+2
-40
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_success.xml
...tem/portal_workflow/send_state_workflow/state_success.xml
+2
-40
product/ERP5/TargetSolver/CopyToTarget.py
product/ERP5/TargetSolver/CopyToTarget.py
+7
-8
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.DateUtils.py
...ntTemplateItem/portal_components/module.erp5.DateUtils.py
+0
-24
No files found.
bt5/erp5_maileva_connector/SkinTemplateItem/portal_skins/erp5_maileva_connector/MailevaSOAPConnector_getAvailableConnector.py
View file @
b35b8d44
maileva_connector
=
context
.
portal_catalog
.
getResultValue
(
portal_type
=
'Maileva SOAP Connector'
,
reference
=
reference
,
validation_state
=
'validated'
)
if
not
maileva_connector
:
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow.xml
View file @
b35b8d44
...
...
@@ -67,10 +67,7 @@
<item>
<key>
<string>
workflow_managed_permission
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
<tuple/>
</value>
</item>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_draft.xml
View file @
b35b8d44
...
...
@@ -9,10 +9,7 @@
<item>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -67,42 +64,7 @@
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
Add portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
Modify portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Associate
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_failed.xml
View file @
b35b8d44
...
...
@@ -9,10 +9,7 @@
<item>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -66,42 +63,7 @@
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
Add portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
Modify portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Associate
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_sending.xml
View file @
b35b8d44
...
...
@@ -9,10 +9,7 @@
<item>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -66,42 +63,7 @@
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
Add portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
Modify portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Associate
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_success.xml
View file @
b35b8d44
...
...
@@ -9,10 +9,7 @@
<item>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<tuple>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -57,42 +54,7 @@
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
Add portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Associate
</string>
<string>
Author
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
Modify portal content
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Authenticated
</string>
<string>
Author
</string>
<string>
Associate
</string>
<string>
Member
</string>
<string>
Assignee
</string>
<string>
Manager
</string>
<string>
Auditor
</string>
<string>
Owner
</string>
<string>
Reviewer
</string>
</tuple>
</value>
</item>
</dictionary>
<dictionary/>
</value>
</item>
</dictionary>
...
...
product/ERP5/TargetSolver/CopyToTarget.py
View file @
b35b8d44
...
...
@@ -28,6 +28,8 @@ from __future__ import absolute_import
#
##############################################################################
import
datetime
from
DateTime
import
DateTime
from
.TargetSolver
import
TargetSolver
class
CopyToTarget
(
TargetSolver
):
...
...
@@ -60,13 +62,11 @@ class CopyToTarget(TargetSolver):
quantity_ratio
=
0
if
old_quantity
not
in
(
None
,
0.0
):
# XXX: What if quantity happens to be an integer ?
quantity_ratio
=
new_quantity
/
old_quantity
start_date_delta
=
0
stop_date_delta
=
0
# get the date delta in milliseconds, to prevent rounding issues
stop_date_delta
=
start_date_delta
=
datetime
.
timedelta
()
if
new_start_date
is
not
None
and
old_start_date
is
not
None
:
start_date_delta
=
new_start_date
.
millis
()
-
old_start_date
.
millis
()
start_date_delta
=
new_start_date
.
asdatetime
()
-
old_start_date
.
asdatetime
()
if
new_stop_date
is
not
None
and
old_stop_date
is
not
None
:
stop_date_delta
=
new_stop_date
.
millis
()
-
old_stop_date
.
millis
()
stop_date_delta
=
new_stop_date
.
asdatetime
()
-
old_stop_date
.
asdatetime
()
return
{
'quantity_ratio'
:
quantity_ratio
,
'start_date_delta'
:
start_date_delta
,
...
...
@@ -87,15 +87,14 @@ class CopyToTarget(TargetSolver):
"""
Generate values to save on simulation movement.
"""
from
erp5.component.module.DateUtils
import
createDateTimeFromMillis
value_dict
=
{}
# Modify quantity, start_date, stop_date
start_date
=
simulation_movement
.
getStartDate
()
if
start_date
is
not
None
:
value_dict
[
'start_date'
]
=
createDateTimeFromMillis
(
start_date
.
millis
()
+
start_date_delta
)
value_dict
[
'start_date'
]
=
DateTime
(
start_date
.
asdatetime
()
+
start_date_delta
)
stop_date
=
simulation_movement
.
getStopDate
()
if
stop_date
is
not
None
:
value_dict
[
'stop_date'
]
=
createDateTimeFromMillis
(
stop_date
.
millis
()
+
stop_date_delta
)
value_dict
[
'stop_date'
]
=
DateTime
(
stop_date
.
asdatetime
()
+
stop_date_delta
)
value_dict
[
'quantity'
]
=
simulation_movement
.
getQuantity
()
*
quantity_ratio
return
value_dict
...
...
product/ERP5/bootstrap/erp5_core/ModuleComponentTemplateItem/portal_components/module.erp5.DateUtils.py
View file @
b35b8d44
...
...
@@ -453,30 +453,6 @@ def convertDateToHour(date=None):
hour_
=
(
ordinal_date
-
ordinal_reference_date
)
*
number_of_hours_in_day
+
number_of_hours_in_day
+
date
.
hour
()
return
int
(
hour_
)
def
createDateTimeFromMillis
(
millis
):
# pylint: disable=redefined-outer-name
"""
Returns a DateTime object, build from the number of milliseconds since epoch.
Parameter should be a int or long.
This one should be used by solvers, as DateTime.__cmp__ actually only
compares the _millis parameter of the two DateTime objects.
This is currently not perfect: DateTime only supports creating a new object
from a floating point number of seconds since epoch, so a rounding issue is
still possible, that's why _millis is explicitely set to the same value
after the DateTime object has been created from (millis / 1000.)
A better way would be to compute (yr,mo,dy,hr,mn,sc,tz,t,d,s,millisecs) from
millis, and then create the DateTime object from it (see "elif ac == 11:" in
DateTime._parse_args).
Another solution would be a DateTime implementation that relies exclusively
on integer values internally.
"""
millis
=
long
(
millis
)
date
=
DateTime
(
millis
/
1000.
)
date
.
_millis
=
millis
return
date
def
getNumberOfDayInMonth
(
date
):
month
=
date
.
month
()
...
...
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