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
e015be48
Commit
e015be48
authored
Dec 23, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: (Test) Add helper method to setup 2 different organisations on templates.
parent
e05d4f16
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+79
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
e015be48
...
...
@@ -777,5 +777,84 @@ return %s""" % (script_name, fake_return ))
return
organisation
def
redefineAccountingTemplatesonPreferencesWithDualOrganisation
(
self
):
# Define a new set of templates and change organisation on them, in this way tests should
# behave the same.
self
.
login
()
fr_organisation
=
self
.
makeCustomOrganisation
()
zh_organisation
=
self
.
makeCustomOrganisation
()
# Update Price currency for Chinese company
zh_organisation
.
setPriceCurrency
(
"currency_module/CNY"
)
accounting_module
=
self
.
portal
.
accounting_module
sale_packing_list_module
=
self
.
portal
.
sale_packing_list_module
preferred_zh_pre_payment_template
=
\
accounting_module
.
slapos_wechat_pre_payment_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_zh_pre_payment_template
.
edit
(
source_section_value
=
zh_organisation
,
source_payment_value
=
zh_organisation
.
bank_account
)
preferred_default_pre_payment_template
=
\
accounting_module
.
slapos_pre_payment_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_template
.
edit
(
source_section_value
=
fr_organisation
,
source_payment_value
=
fr_organisation
.
bank_account
)
preferred_zh_pre_payment_subscription_invoice_template
=
\
accounting_module
.
template_wechat_pre_payment_subscription_sale_invoice_transaction
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_zh_pre_payment_subscription_invoice_template
.
edit
(
source_section_value
=
zh_organisation
,
source_value
=
zh_organisation
)
preferred_default_pre_payment_subscription_invoice_template
=
\
accounting_module
.
template_pre_payment_subscription_sale_invoice_transaction
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_default_pre_payment_subscription_invoice_template
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
preferred_instance_delivery_template
=
\
sale_packing_list_module
.
slapos_accounting_instance_delivery_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_instance_delivery_template
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
open_sale_order_module
=
self
.
portal
.
open_sale_order_module
preferred_open_sale_order_template
=
\
open_sale_order_module
.
slapos_accounting_open_sale_order_template
.
Base_createCloneDocument
(
batch_mode
=
1
)
preferred_open_sale_order_template
.
edit
(
source_section_value
=
fr_organisation
,
source_value
=
fr_organisation
)
system_preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
system_preference
.
edit
(
preferred_default_pre_payment_template
=
preferred_default_pre_payment_template
.
getRelativeUrl
(),
preferred_zh_pre_payment_template
=
preferred_zh_pre_payment_template
.
getRelativeUrl
(),
preferred_zh_pre_payment_subscription_invoice_template
=
\
preferred_zh_pre_payment_subscription_invoice_template
.
getRelativeUrl
(),
preferred_default_pre_payment_subscription_invoice_template
=
\
preferred_default_pre_payment_subscription_invoice_template
.
getRelativeUrl
(),
preferred_instance_delivery_template
=
\
preferred_instance_delivery_template
.
getRelativeUrl
(),
preferred_open_sale_order_template
=
\
preferred_open_sale_order_template
.
getRelativeUrl
()
)
self
.
tic
()
return
fr_organisation
,
zh_organisation
class
SlapOSTestCaseMixinWithAbort
(
SlapOSTestCaseMixin
):
abort_transaction
=
1
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