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
18
Merge Requests
18
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
437d9034
Commit
437d9034
authored
Nov 13, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse templates.
parent
d8b2e1e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
24 deletions
+20
-24
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
...ns/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
+1
-11
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_updateOpenSaleOrder.xml
...al_skins/slapos_accounting/Person_updateOpenSaleOrder.xml
+9
-6
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
...apOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
+9
-6
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_storeOpenSaleOrderJournal.xml
View file @
437d9034
...
@@ -72,21 +72,11 @@ def getWorkflowDate(document, action):\n
...
@@ -72,21 +72,11 @@ def getWorkflowDate(document, action):\n
return item.get(\'time\')\n
return item.get(\'time\')\n
raise ValueError(\'Document %s has no action %s\' % (document.getPath(), action))\n
raise ValueError(\'Document %s has no action %s\' % (document.getPath(), action))\n
\n
\n
subscription_service_relative_url=portal.portal_preferences.getPreferredInstanceSubscriptionResource()\n
common_add_kw = dict(\n
portal_type="Open Sale Order Line",\n
quantity=1,\n
quantity_unit="unit/piece",\n
# XXX Hardcoded values\n
resource=subscription_service_relative_url,\n
price=portal.restrictedTraverse(subscription_service_relative_url).getSaleSupplyLineBasePrice()\n
)\n
for hosting_subscription in portal.portal_catalog(\n
for hosting_subscription in portal.portal_catalog(\n
portal_type=\'Hosting Subscription\',\n
portal_type=\'Hosting Subscription\',\n
**hosting_kw\n
**hosting_kw\n
):\n
):\n
add_kw = common_add_kw.copy()\n
add_kw = dict(\n
add_kw.update(\n
title=hosting_subscription.getTitle(),\n
title=hosting_subscription.getTitle(),\n
aggregate=hosting_subscription.getRelativeUrl()\n
aggregate=hosting_subscription.getRelativeUrl()\n
)\n
)\n
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Person_updateOpenSaleOrder.xml
View file @
437d9034
...
@@ -79,14 +79,13 @@ previous_open_sale_order = portal.portal_catalog.getResultValue(\n
...
@@ -79,14 +79,13 @@ previous_open_sale_order = portal.portal_catalog.getResultValue(\n
validation_state="validated")\n
validation_state="validated")\n
\n
\n
if previous_open_sale_order is None:\n
if previous_open_sale_order is None:\n
open_sale_order = portal.open_sale_order_module.newContent(\n
open_sale_order_template = portal.restrictedTraverse(\n
source=\'organisation_module/vifib_internet\',\n
portal.portal_preferences.getPreferredOpenSaleOrderTemplate())\n
source_section=\'organisation_module/vifib_internet\',\n
open_sale_order = open_sale_order_template.Base_createCloneDocument(batch_mode=1)\n
open_sale_order.edit(\n
destination_section=person.getRelativeUrl(),\n
destination_section=person.getRelativeUrl(),\n
destination_decision=person.getRelativeUrl(),\n
destination_decision=person.getRelativeUrl(),\n
destination=person.getRelativeUrl(),\n
destination=person.getRelativeUrl(),\n
price_currency=\'currency_module/EUR\',\n
specialise=\'sale_trade_condition_module/vifib_trade_condition\',\n
title="SlapOS Subscription Open Sale Order",\n
title="SlapOS Subscription Open Sale Order",\n
effective_date=now,\n
effective_date=now,\n
activate_kw=activate_kw)\n
activate_kw=activate_kw)\n
...
@@ -102,9 +101,13 @@ if previous_open_sale_order is not None:\n
...
@@ -102,9 +101,13 @@ if previous_open_sale_order is not None:\n
open_sale_order.order(activate_kw=activate_kw)\n
open_sale_order.order(activate_kw=activate_kw)\n
open_sale_order.validate(activate_kw=activate_kw)\n
open_sale_order.validate(activate_kw=activate_kw)\n
\n
\n
open_sale_order_line_template = portal.restrictedTraverse(\n
portal.portal_preferences.getPreferredOpenSaleOrderLineTemplate())\n
for kw in add_kw_kw.itervalues():\n
for kw in add_kw_kw.itervalues():\n
explanation_list = kw.pop(\'explanation\', [])\n
explanation_list = kw.pop(\'explanation\', [])\n
line = open_sale_order.newContent(activate_kw=activate_kw, **kw)\n
line = open_sale_order_line_template.Base_createCloneDocument(batch_mode=1,\n
destination=open_sale_order)\n
line.edit(activate_kw=activate_kw, **kw)\n
for explanation in explanation_list:\n
for explanation in explanation_list:\n
storeWorkflowComment(line, explanation)\n
storeWorkflowComment(line, explanation)\n
\n
\n
...
...
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
View file @
437d9034
...
@@ -231,8 +231,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
...
@@ -231,8 +231,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
line
=
open_sale_order_line_list
[
0
].
getObject
()
line
=
open_sale_order_line_list
[
0
].
getObject
()
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
.
getPreferredInstanceSubscriptionResource
(),
line
.
getResource
())
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
line
.
getResource
())
self
.
assertEqual
(
None
,
line
.
getStartDate
())
self
.
assertEqual
(
None
,
line
.
getStartDate
())
def
test_usualLifetime_HostingSubscription
(
self
):
def
test_usualLifetime_HostingSubscription
(
self
):
...
@@ -276,8 +278,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
...
@@ -276,8 +278,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
line
=
open_sale_order_line_list
[
0
].
getObject
()
line
=
open_sale_order_line_list
[
0
].
getObject
()
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
.
getPreferredInstanceSubscriptionResource
(),
line
.
getResource
())
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
line
.
getResource
())
self
.
assertEqual
(
request_time
,
line
.
getStartDate
())
self
.
assertEqual
(
request_time
,
line
.
getStartDate
())
destroy_time
=
DateTime
(
'2012/02/01'
)
destroy_time
=
DateTime
(
'2012/02/01'
)
...
@@ -325,8 +329,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
...
@@ -325,8 +329,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
archived_line
.
getAggregate
())
archived_line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
.
getPreferredInstanceSubscriptionResource
(),
archived_line
.
getResource
())
archived_line
.
getResource
())
self
.
assertEqual
(
request_time
,
archived_line
.
getStartDate
())
self
.
assertEqual
(
request_time
,
archived_line
.
getStartDate
())
...
...
master/bt5/slapos_accounting/bt/revision
View file @
437d9034
13
14
\ 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