Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Lu Xu
slapos.core
Commits
facd7811
Commit
facd7811
authored
Feb 02, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split locking/unlocking to two alarms.
parent
3949f204
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
192 additions
and
14 deletions
+192
-14
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_lock_person.xml
...slap/PathTemplateItem/portal_alarms/vifib_lock_person.xml
+3
-3
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_unlock_person.xml
...ap/PathTemplateItem/portal_alarms/vifib_unlock_person.xml
+91
-0
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_lockPerson.xml
...TemplateItem/portal_skins/vifib_slap/Alarm_lockPerson.xml
+4
-2
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_unlockPerson.xml
...mplateItem/portal_skins/vifib_slap/Alarm_unlockPerson.xml
+84
-0
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_manageLockByBalance.xml
...em/portal_skins/vifib_slap/Person_manageLockByBalance.xml
+7
-7
master/bt5/vifib_slap/bt/revision
master/bt5/vifib_slap/bt/revision
+1
-1
master/bt5/vifib_slap/bt/template_path_list
master/bt5/vifib_slap/bt/template_path_list
+2
-1
No files found.
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_
manage_person_lock
.xml
→
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_
lock_person
.xml
View file @
facd7811
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_
managePersonLock
</string>
</value>
<value>
<string>
Alarm_
lockPerson
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
description
</string>
</key>
<key>
<string>
description
</string>
</key>
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
vifib_
manage_person_lock
</string>
</value>
<value>
<string>
vifib_
lock_person
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<key>
<string>
periodicity_hour
</string>
</key>
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
title
</string>
</key>
<key>
<string>
title
</string>
</key>
<value>
<string>
Manages person locks
</string>
</value>
<value>
<string>
Locks Person if needed
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/vifib_slap/PathTemplateItem/portal_alarms/vifib_unlock_person.xml
0 → 100644
View file @
facd7811
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_unlockPerson
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
vifib_unlock_person
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<int>
5
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
946684800.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Unlocks Person if possible
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_
managePersonLock
.xml
→
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_
lockPerson
.xml
View file @
facd7811
...
@@ -58,10 +58,12 @@ method_kw.update(\n
...
@@ -58,10 +58,12 @@ method_kw.update(\n
maximum_due_date=(DateTime() - context.portal_preferences.getPreferredMaximumDueDay()).Date(),\n
maximum_due_date=(DateTime() - context.portal_preferences.getPreferredMaximumDueDay()).Date(),\n
simulation_state=context.getPortalCurrentInventoryStateList() + context.getPortalTransitInventoryStateList(),\n
simulation_state=context.getPortalCurrentInventoryStateList() + context.getPortalTransitInventoryStateList(),\n
ongoing_simulation_state=context.getPortalFutureInventoryStateList() + context.getPortalReservedInventoryStateList(),\n
ongoing_simulation_state=context.getPortalFutureInventoryStateList() + context.getPortalReservedInventoryStateList(),\n
section_uid=context.restrictedTraverse(\'organisation_module/vifib_internet\').getUid(), \n
section_uid=context.restrictedTraverse(\'organisation_module/vifib_internet\').getUid(),\n
operation=\'lock\'\n
)\n
)\n
portal_catalog.searchAndActivate(\n
portal_catalog.searchAndActivate(\n
method_id=\'Person_manageLockByBalance\',\n
method_id=\'Person_manageLockByBalance\',\n
payment_state=\'unlocked\',\n
portal_type=\'Person\',\n
portal_type=\'Person\',\n
activate_kw={\'tag\': tag},\n
activate_kw={\'tag\': tag},\n
method_kw=method_kw\n
method_kw=method_kw\n
...
@@ -74,7 +76,7 @@ portal_catalog.searchAndActivate(\n
...
@@ -74,7 +76,7 @@ portal_catalog.searchAndActivate(\n
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_
managePersonLock
</string>
</value>
<value>
<string>
Alarm_
lockPerson
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_unlockPerson.xml
0 → 100644
View file @
facd7811
<?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>
_body
</string>
</key>
<value>
<string>
portal_catalog = context.getPortalObject().portal_catalog\n
from DateTime import DateTime\n
method_kw = {}\n
method_kw.update(\n
maximum_balance=context.portal_preferences.getPreferredMaximumBalance(),\n
maximum_due_date=(DateTime() - context.portal_preferences.getPreferredMaximumDueDay()).Date(),\n
simulation_state=context.getPortalCurrentInventoryStateList() + context.getPortalTransitInventoryStateList(),\n
ongoing_simulation_state=context.getPortalFutureInventoryStateList() + context.getPortalReservedInventoryStateList(),\n
section_uid=context.restrictedTraverse(\'organisation_module/vifib_internet\').getUid(),\n
operation=\'unlock\'\n
)\n
portal_catalog.searchAndActivate(\n
method_id=\'Person_manageLockByBalance\',\n
payment_state=\'locked\',\n
portal_type=\'Person\',\n
activate_kw={\'tag\': tag},\n
method_kw=method_kw\n
)\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_unlockPerson
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Person_manageLockByBalance.xml
View file @
facd7811
...
@@ -62,7 +62,7 @@ balance = context.portal_simulation.getInventoryAssetPrice(\n
...
@@ -62,7 +62,7 @@ balance = context.portal_simulation.getInventoryAssetPrice(\n
\n
\n
if maximum_balance >
balance:\n
if maximum_balance >
balance:\n
# customer reached his balance, shall be locked\n
# customer reached his balance, shall be locked\n
if not locked:\n
if not locked
and operation == \'lock\'
:\n
context.lock()\n
context.lock()\n
return\n
return\n
\n
\n
...
@@ -75,11 +75,11 @@ if context.portal_catalog.countResults(\n
...
@@ -75,11 +75,11 @@ if context.portal_catalog.countResults(\n
\'delivery.start_date\': \'
<
= %s\' % maximum_due_date\n
\'delivery.start_date\': \'
<
= %s\' % maximum_due_date\n
})[0][0] > 0:\n
})[0][0] > 0:\n
# there are ongoing old payments, shall be locked\n
# there are ongoing old payments, shall be locked\n
if not locked:\n
if not locked
and operation == \'lock\'
:\n
context.lock()\n
context.lock()\n
else:\n
else:\n
# there are no ongoing payments and balance is acceptable\n
# there are no ongoing payments and balance is acceptable\n
if locked:\n
if locked
and operation == \'unlock\'
:\n
context.unlock()\n
context.unlock()\n
...
@@ -87,7 +87,7 @@ else:\n
...
@@ -87,7 +87,7 @@ else:\n
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
maximum_balance, maximum_due_date, simulation_state, section_uid, ongoing_simulation_state
</string>
</value>
<value>
<string>
maximum_balance, maximum_due_date, simulation_state, section_uid, ongoing_simulation_state
, operation
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/vifib_slap/bt/revision
View file @
facd7811
529
530
\ No newline at end of file
\ No newline at end of file
master/bt5/vifib_slap/bt/template_path_list
View file @
facd7811
portal_alarms/confirm_ordered_sale_order
portal_alarms/confirm_ordered_sale_order
portal_alarms/stop_planned_sale_invoice_transaction
portal_alarms/stop_planned_sale_invoice_transaction
portal_alarms/vifib_check_consistency
portal_alarms/vifib_check_consistency
portal_alarms/vifib_lock_person
portal_alarms/vifib_lock_software_instance
portal_alarms/vifib_lock_software_instance
portal_alarms/vifib_manage_person_lock
portal_alarms/vifib_trigger_build
portal_alarms/vifib_trigger_build
portal_alarms/vifib_unlock_person
portal_alarms/vifib_unlock_software_instance
portal_alarms/vifib_unlock_software_instance
portal_alarms/vifib_update_open_sale_order_line
portal_alarms/vifib_update_open_sale_order_line
\ No newline at end of file
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