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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
be04eff1
Commit
be04eff1
authored
May 30, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support documents w/o Sale Order.
parent
5b9d4b6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
...al_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
+20
-21
master/bt5/vifib_upgrader/bt/revision
master/bt5/vifib_upgrader/bt/revision
+1
-1
No files found.
master/bt5/vifib_upgrader/SkinTemplateItem/portal_skins/vifib_upgrader/SlapDocument_migrateSlapState.xml
View file @
be04eff1
...
@@ -77,7 +77,21 @@ portal_type = slap_document.getPortalType()\n
...
@@ -77,7 +77,21 @@ portal_type = slap_document.getPortalType()\n
if portal_type not in portal_type_list:\n
if portal_type not in portal_type_list:\n
raise TypeError(\'%s is not %s\' % (slap_document.getPath(), portal_type_list))\n
raise TypeError(\'%s is not %s\' % (slap_document.getPath(), portal_type_list))\n
\n
\n
sale_order_line = slap_document.getAggregateRelatedValue(portal_type=\'Sale Order Line\')\n
explanation_delivery_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List Line\',\n
query=ComplexQuery(\n
Query(default_aggregate_uid=slap_document.getUid()),\n
Query(default_resource_uid=[\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceSetupResource()).getUid(),\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceHostingResource()).getUid(),\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceCleanupResource()).getUid(),\n
]),\n
operator=\'AND\',\n
),\n
sort_on=((\'movement.start_date\', \'DESC\'),)\n
)\n
if explanation_delivery_line is None:\n
explanation_delivery_line = slap_document.getAggregateRelatedValue(portal_type=\'Sale Order Line\')\n
\n
\n
\n
\n
if portal_type == \'Hosting Subscription\':\n
if portal_type == \'Hosting Subscription\':\n
...
@@ -86,11 +100,11 @@ if portal_type == \'Hosting Subscription\':\n
...
@@ -86,11 +100,11 @@ if portal_type == \'Hosting Subscription\':\n
setUpPeriodicity(slap_document)\n
setUpPeriodicity(slap_document)\n
# Person is now directly associated on the HS\n
# Person is now directly associated on the HS\n
slap_document.edit(\n
slap_document.edit(\n
destination_section_value=
sale_order
_line.getDestinationSectionValue(portal_type="Person"),\n
destination_section_value=
explanation_delivery
_line.getDestinationSectionValue(portal_type="Person"),\n
)\n
)\n
assert(slap_document.getDestinationSection() ==
sale_order
_line.getDestinationSectionValue().getRelativeUrl())\n
assert(slap_document.getDestinationSection() ==
explanation_delivery
_line.getDestinationSectionValue().getRelativeUrl())\n
else:\n
else:\n
hosting_subscription =
sale_order
_line.getAggregateValue(portal_type=\'Hosting Subscription\')\n
hosting_subscription =
explanation_delivery
_line.getAggregateValue(portal_type=\'Hosting Subscription\')\n
slap_document.edit(\n
slap_document.edit(\n
specialise_value=hosting_subscription\n
specialise_value=hosting_subscription\n
)\n
)\n
...
@@ -108,22 +122,6 @@ if portal_type == \'Hosting Subscription\':\n
...
@@ -108,22 +122,6 @@ if portal_type == \'Hosting Subscription\':\n
\'shared\': slap_document.isRootSlave()\n
\'shared\': slap_document.isRootSlave()\n
}\n
}\n
else:\n
else:\n
explanation_delivery_line = portal.portal_catalog.getResultValue(\n
portal_type=\'Sale Packing List Line\',\n
query=ComplexQuery(\n
Query(default_aggregate_uid=slap_document.getUid()),\n
Query(default_resource_uid=[\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceSetupResource()).getUid(),\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceHostingResource()).getUid(),\n
portal.restrictedTraverse(portal.portal_preferences.getPreferredInstanceCleanupResource()).getUid(),\n
]),\n
operator=\'AND\',\n
),\n
sort_on=((\'movement.start_date\', \'DESC\'),)\n
)\n
if explanation_delivery_line is None:\n
explanation_delivery_line = sale_order_line\n
\n
if explanation_delivery_line.getPortalType() == \'Sale Packing List Line\':\n
if explanation_delivery_line.getPortalType() == \'Sale Packing List Line\':\n
resource = explanation_delivery_line.getResource()\n
resource = explanation_delivery_line.getResource()\n
if resource == portal.portal_preferences.getPreferredInstanceSetupResource():\n
if resource == portal.portal_preferences.getPreferredInstanceSetupResource():\n
...
@@ -189,7 +187,8 @@ else:\n
...
@@ -189,7 +187,8 @@ else:\n
explanation_delivery_line.getSimulationState() == \'delivered\'):\n
explanation_delivery_line.getSimulationState() == \'delivered\'):\n
slap_document.invalidate()\n
slap_document.invalidate()\n
else:\n
else:\n
assert(slap_document.getValidationState() == \'validated\')\n
if not(slap_document.getValidationState() == \'validated\'):\n
raise ValueError(\'%s != %s\' % (slap_document.getValidationState(), \'validated\'))\n
]]>
</string>
</value>
]]>
</string>
</value>
...
...
master/bt5/vifib_upgrader/bt/revision
View file @
be04eff1
92
93
\ No newline at end of file
\ 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