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
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Jérome Perrin
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
Hide 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
(
maileva_connector
=
context
.
portal_catalog
.
getResultValue
(
portal_type
=
'Maileva SOAP Connector'
,
reference
=
reference
,
reference
=
reference
,
validation_state
=
'validated'
)
validation_state
=
'validated'
)
if
not
maileva_connector
:
if
not
maileva_connector
:
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow.xml
View file @
b35b8d44
...
@@ -67,10 +67,7 @@
...
@@ -67,10 +67,7 @@
<item>
<item>
<key>
<string>
workflow_managed_permission
</string>
</key>
<key>
<string>
workflow_managed_permission
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_draft.xml
View file @
b35b8d44
...
@@ -9,10 +9,7 @@
...
@@ -9,10 +9,7 @@
<item>
<item>
<key>
<string>
acquire_permission
</string>
</key>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -67,42 +64,7 @@
...
@@ -67,42 +64,7 @@
<item>
<item>
<key>
<string>
data
</string>
</key>
<key>
<string>
data
</string>
</key>
<value>
<value>
<dictionary>
<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>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_failed.xml
View file @
b35b8d44
...
@@ -9,10 +9,7 @@
...
@@ -9,10 +9,7 @@
<item>
<item>
<key>
<string>
acquire_permission
</string>
</key>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -66,42 +63,7 @@
...
@@ -66,42 +63,7 @@
<item>
<item>
<key>
<string>
data
</string>
</key>
<key>
<string>
data
</string>
</key>
<value>
<value>
<dictionary>
<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>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_sending.xml
View file @
b35b8d44
...
@@ -9,10 +9,7 @@
...
@@ -9,10 +9,7 @@
<item>
<item>
<key>
<string>
acquire_permission
</string>
</key>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -66,42 +63,7 @@
...
@@ -66,42 +63,7 @@
<item>
<item>
<key>
<string>
data
</string>
</key>
<key>
<string>
data
</string>
</key>
<value>
<value>
<dictionary>
<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>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
...
bt5/erp5_maileva_connector/WorkflowTemplateItem/portal_workflow/send_state_workflow/state_success.xml
View file @
b35b8d44
...
@@ -9,10 +9,7 @@
...
@@ -9,10 +9,7 @@
<item>
<item>
<key>
<string>
acquire_permission
</string>
</key>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<value>
<tuple>
<tuple/>
<string>
Modify portal content
</string>
<string>
Add portal content
</string>
</tuple>
</value>
</value>
</item>
</item>
<item>
<item>
...
@@ -57,42 +54,7 @@
...
@@ -57,42 +54,7 @@
<item>
<item>
<key>
<string>
data
</string>
</key>
<key>
<string>
data
</string>
</key>
<value>
<value>
<dictionary>
<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>
</value>
</value>
</item>
</item>
</dictionary>
</dictionary>
...
...
product/ERP5/TargetSolver/CopyToTarget.py
View file @
b35b8d44
...
@@ -28,6 +28,8 @@ from __future__ import absolute_import
...
@@ -28,6 +28,8 @@ from __future__ import absolute_import
#
#
##############################################################################
##############################################################################
import
datetime
from
DateTime
import
DateTime
from
.TargetSolver
import
TargetSolver
from
.TargetSolver
import
TargetSolver
class
CopyToTarget
(
TargetSolver
):
class
CopyToTarget
(
TargetSolver
):
...
@@ -60,13 +62,11 @@ class CopyToTarget(TargetSolver):
...
@@ -60,13 +62,11 @@ class CopyToTarget(TargetSolver):
quantity_ratio
=
0
quantity_ratio
=
0
if
old_quantity
not
in
(
None
,
0.0
):
# XXX: What if quantity happens to be an integer ?
if
old_quantity
not
in
(
None
,
0.0
):
# XXX: What if quantity happens to be an integer ?
quantity_ratio
=
new_quantity
/
old_quantity
quantity_ratio
=
new_quantity
/
old_quantity
start_date_delta
=
0
stop_date_delta
=
start_date_delta
=
datetime
.
timedelta
()
stop_date_delta
=
0
# get the date delta in milliseconds, to prevent rounding issues
if
new_start_date
is
not
None
and
old_start_date
is
not
None
:
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
:
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
{
return
{
'quantity_ratio'
:
quantity_ratio
,
'quantity_ratio'
:
quantity_ratio
,
'start_date_delta'
:
start_date_delta
,
'start_date_delta'
:
start_date_delta
,
...
@@ -87,15 +87,14 @@ class CopyToTarget(TargetSolver):
...
@@ -87,15 +87,14 @@ class CopyToTarget(TargetSolver):
"""
"""
Generate values to save on simulation movement.
Generate values to save on simulation movement.
"""
"""
from
erp5.component.module.DateUtils
import
createDateTimeFromMillis
value_dict
=
{}
value_dict
=
{}
# Modify quantity, start_date, stop_date
# Modify quantity, start_date, stop_date
start_date
=
simulation_movement
.
getStartDate
()
start_date
=
simulation_movement
.
getStartDate
()
if
start_date
is
not
None
:
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
()
stop_date
=
simulation_movement
.
getStopDate
()
if
stop_date
is
not
None
:
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
value_dict
[
'quantity'
]
=
simulation_movement
.
getQuantity
()
*
quantity_ratio
return
value_dict
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):
...
@@ -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
()
hour_
=
(
ordinal_date
-
ordinal_reference_date
)
*
number_of_hours_in_day
+
number_of_hours_in_day
+
date
.
hour
()
return
int
(
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
):
def
getNumberOfDayInMonth
(
date
):
month
=
date
.
month
()
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