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
Labels
Merge Requests
19
Merge Requests
19
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
nexedi
slapos.core
Commits
22827f97
Commit
22827f97
authored
May 22, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update packing list can not be created as a clone if the instance has never been started.
parent
83d0713f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
26 deletions
+102
-26
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseParameter.xml
...tion_workflow/scripts/Instance_changePromiseParameter.xml
+4
-1
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseState.xml
...eraction_workflow/scripts/Instance_changePromiseState.xml
+1
-24
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_createSalePackingList.xml
...ction_workflow/scripts/Instance_createSalePackingList.xml
+96
-0
master/bt5/vifib_slapos_accounting/bt/revision
master/bt5/vifib_slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseParameter.xml
View file @
22827f97
...
...
@@ -64,7 +64,10 @@ if (state in (started, stopped)):\n
delivery = instance.getCausalityValue(portal_type=["Sale Packing List"])\n
update_service_relative_url = portal.portal_preferences.getPreferredInstanceUpdateResource()\n
\n
new_delivery = delivery.Base_createCloneDocument(batch_mode=1)\n
if delivery is None:\n
new_delivery = context.Instance_createSalePackingList(state_change, portal.restrictedTraverse(update_service_relative_url))\n
else:\n
new_delivery = delivery.Base_createCloneDocument(batch_mode=1)\n
new_delivery.edit(start_date=DateTime(), stop_date=DateTime())\n
new_delivery.contentValues(portal_type="Sale Packing List Line")[0].edit(resource=update_service_relative_url)\n
new_delivery.confirm()\n
...
...
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseState.xml
View file @
22827f97
...
...
@@ -141,20 +141,6 @@ else:\n
instance.edit(causality_value=packing_list)\n
else:\n
# Create a new packing list from scratch\n
sale_order_line = delivery.contentValues(portal_type=sale_order_line_portal_type)[0]\n
\n
packing_list_module = portal.getDefaultModule(portal_type=\'Sale Packing List\')\n
packing_list = packing_list_module.newContent(\n
portal_type=\'Sale Packing List\',\n
specialise=delivery.getSpecialise() or delivery.getCausalityValue().getSpecialise(),\n
destination=delivery.getDestination(),\n
destination_section=delivery.getDestinationSection(),\n
destination_decision=delivery.getDestinationDecision(),\n
source=delivery.getSource(),\n
source_section=delivery.getSourceSection(),\n
price_currency=delivery.getPriceCurrency(),\n
start_date=DateTime())\n
\n
if (state == started):\n
service_relative_url = hosting_service_relative_url\n
service = hosting_service\n
...
...
@@ -162,16 +148,7 @@ else:\n
service_relative_url = cleanup_service_relative_url\n
service = cleanup_service\n
\n
packing_list_line = packing_list.newContent(\n
portal_type=\'Sale Packing List Line\',\n
resource=service_relative_url,\n
quantity_unit="unit/piece",\n
quantity=1,\n
aggregate_list=sale_order_line.getAggregateList(),\n
# XXX Hardcode price on service\n
price=service.getSaleSupplyLineBasePrice(),\n
)\n
\n
packing_list = context.Instance_createSalePackingList(state_change, service)\n
instance.edit(causality_value=packing_list)\n
\n
if (state == started):\n
...
...
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_createSalePackingList.xml
0 → 100644
View file @
22827f97
<?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>
instance = state_change[\'object\']\n
\n
# Get current sale order\n
delivery = instance.getCausalityValue(portal_type=["Sale Order"])\n
\n
sale_order_line = delivery.contentValues(portal_type="Sale Order Line")[0]\n
\n
packing_list_module = portal.getDefaultModule(portal_type=\'Sale Packing List\')\n
packing_list = packing_list_module.newContent(\n
portal_type=\'Sale Packing List\',\n
specialise=delivery.getSpecialise() or delivery.getCausalityValue().getSpecialise(),\n
destination=delivery.getDestination(),\n
destination_section=delivery.getDestinationSection(),\n
destination_decision=delivery.getDestinationDecision(),\n
source=delivery.getSource(),\n
source_section=delivery.getSourceSection(),\n
price_currency=delivery.getPriceCurrency(),\n
start_date=DateTime())\n
\n
packing_list_line = packing_list.newContent(\n
portal_type=\'Sale Packing List Line\',\n
resource=service.getRelativeUrl(),\n
quantity_unit="unit/piece",\n
quantity=1,\n
aggregate_list=sale_order_line.getAggregateList(),\n
# XXX Hardcode price on service\n
price=service.getSaleSupplyLineBasePrice(),\n
)\n
\n
return packing_list\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change, service
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Instance_createSalePackingList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/bt/revision
View file @
22827f97
16
\ No newline at end of file
17
\ 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