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
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
preetwinder
erp5
Commits
99cd2b53
Commit
99cd2b53
authored
Apr 14, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alarm: new option to solve automatically
parent
c864cd8b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
249 additions
and
2 deletions
+249
-2
product/ERP5/Tool/AlarmTool.py
product/ERP5/Tool/AlarmTool.py
+4
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_view.xml
...re/SkinTemplateItem/portal_skins/erp5_core/Alarm_view.xml
+2
-1
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_view/my_automatic_solve.xml
.../portal_skins/erp5_core/Alarm_view/my_automatic_solve.xml
+168
-0
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Alarm/automatic_solve_property.xml
...portal_property_sheets/Alarm/automatic_solve_property.xml
+53
-0
product/ERP5/tests/testAlarm.py
product/ERP5/tests/testAlarm.py
+22
-0
No files found.
product/ERP5/Tool/AlarmTool.py
View file @
99cd2b53
...
@@ -139,7 +139,10 @@ class AlarmTool(TimerServiceMixin, BaseTool):
...
@@ -139,7 +139,10 @@ class AlarmTool(TimerServiceMixin, BaseTool):
if
alarm
.
isActive
()
or
not
alarm
.
isEnabled
():
if
alarm
.
isActive
()
or
not
alarm
.
isEnabled
():
# do nothing if already active, or not enabled
# do nothing if already active, or not enabled
continue
continue
alarm
.
activeSense
()
if
alarm
.
isAutomaticSolve
():
alarm
.
solve
()
else
:
alarm
.
activeSense
()
finally
:
finally
:
setSecurityManager
(
security_manager
)
setSecurityManager
(
security_manager
)
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_view.xml
View file @
99cd2b53
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"ERP5
Form"
module=
"Products.ERP5Form.Form
"
/>
<global
name=
"ERP5
Form"
module=
"erp5.portal_type
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<string>
my_solve_method_id
</string>
<string>
my_solve_method_id
</string>
<string>
my_configuration_form_id
</string>
<string>
my_configuration_form_id
</string>
<string>
my_enabled
</string>
<string>
my_enabled
</string>
<string>
my_automatic_solve
</string>
<string>
my_alarm_date
</string>
<string>
my_alarm_date
</string>
</list>
</list>
</value>
</value>
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Alarm_view/my_automatic_solve.xml
0 → 100644
View file @
99cd2b53
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"CheckBoxField"
module=
"Products.Formulator.StandardFields"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_automatic_solve
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Solve Automatically
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/bootstrap/erp5_property_sheets/PropertySheetTemplateItem/portal_property_sheets/Alarm/automatic_solve_property.xml
0 → 100644
View file @
99cd2b53
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Standard Property"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mode
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
elementary_type/boolean
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
the method used to check things
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
automatic_solve_property
</string>
</value>
</item>
<item>
<key>
<string>
mode
</string>
</key>
<value>
<string>
w
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Standard Property
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
product/ERP5/tests/testAlarm.py
View file @
99cd2b53
...
@@ -419,6 +419,28 @@ class TestAlarm(ERP5TypeTestCase):
...
@@ -419,6 +419,28 @@ class TestAlarm(ERP5TypeTestCase):
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
alarm
.
getDescription
(),
'a'
)
self
.
assertEqual
(
alarm
.
getDescription
(),
'a'
)
def
test_automatic_solve
(
self
):
alarm
=
self
.
newAlarm
()
alarm
.
setEnabled
(
True
)
alarm
.
setAutomaticSolve
(
True
)
alarm
.
setPeriodicityStartDate
(
addToDate
(
DateTime
(),
day
=-
1
))
alarm
.
setPeriodicityMinuteFrequency
(
1
)
sense_method_id
=
'Alarm_testSenseMethodWithAutomaticSolve'
skin_folder_id
=
'custom'
skin_folder
=
self
.
getPortal
().
portal_skins
[
skin_folder_id
]
skin_folder
.
manage_addProduct
[
'PythonScripts'
]
\
.
manage_addPythonScript
(
id
=
sense_method_id
)
skin_folder
[
sense_method_id
].
ZPythonScript_edit
(
'fixit=0, *args,**kw'
,
'if fixit: context.setDescription("fixed")'
)
alarm
.
setActiveSenseMethodId
(
sense_method_id
)
self
.
tic
()
self
.
portal
.
portal_alarms
.
tic
()
self
.
tic
()
self
.
assertEqual
(
alarm
.
getDescription
(),
'fixed'
)
def
test_18_alarm_activities_execution_order
(
self
):
def
test_18_alarm_activities_execution_order
(
self
):
"""
"""
Make sure active process created by an alarm get the right tag
Make sure active process created by an alarm get the right tag
...
...
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