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
Titouan Soulard
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
return item.get(\'time\')\n
raise ValueError(\'Document %s has no action %s\' % (document.getPath(), action))\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
portal_type=\'Hosting Subscription\',\n
**hosting_kw\n
):\n
add_kw = common_add_kw.copy()\n
add_kw.update(\n
add_kw = dict(\n
title=hosting_subscription.getTitle(),\n
aggregate=hosting_subscription.getRelativeUrl()\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
validation_state="validated")\n
\n
if previous_open_sale_order is None:\n
open_sale_order = portal.open_sale_order_module.newContent(\n
source=\'organisation_module/vifib_internet\',\n
source_section=\'organisation_module/vifib_internet\',\n
open_sale_order_template = portal.restrictedTraverse(\n
portal.portal_preferences.getPreferredOpenSaleOrderTemplate())\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_decision=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
effective_date=now,\n
activate_kw=activate_kw)\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.validate(activate_kw=activate_kw)\n
\n
open_sale_order_line_template = portal.restrictedTraverse(\n
portal.portal_preferences.getPreferredOpenSaleOrderLineTemplate())\n
for kw in add_kw_kw.itervalues():\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
storeWorkflowComment(line, explanation)\n
\n
...
...
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
View file @
437d9034
...
...
@@ -231,8 +231,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
line
=
open_sale_order_line_list
[
0
].
getObject
()
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
.
getPreferredInstanceSubscriptionResource
(),
line
.
getResource
())
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
line
.
getResource
())
self
.
assertEqual
(
None
,
line
.
getStartDate
())
def
test_usualLifetime_HostingSubscription
(
self
):
...
...
@@ -276,8 +278,10 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
line
=
open_sale_order_line_list
[
0
].
getObject
()
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
.
getPreferredInstanceSubscriptionResource
(),
line
.
getResource
())
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
line
.
getResource
())
self
.
assertEqual
(
request_time
,
line
.
getStartDate
())
destroy_time
=
DateTime
(
'2012/02/01'
)
...
...
@@ -325,8 +329,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
archived_line
.
getAggregate
())
self
.
assertEqual
(
self
.
portal
.
portal_preferences
\
.
getPreferredInstanceSubscriptionResource
(),
self
.
assertEqual
(
open_sale_order_line_template
.
getResource
(),
archived_line
.
getResource
())
self
.
assertEqual
(
request_time
,
archived_line
.
getStartDate
())
...
...
master/bt5/slapos_accounting/bt/revision
View file @
437d9034
13
\ No newline at end of file
14
\ 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