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
Roque
slapos.core
Commits
7c3f0dba
Commit
7c3f0dba
authored
May 17, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: No need this script, use Entity_getOutstandingDepositAmountList for now
parent
f1dc41ed
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
95 deletions
+17
-95
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Entity_getOutstandingDepositAmount.py
...s/slapos_accounting/Entity_getOutstandingDepositAmount.py
+0
-21
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Entity_getOutstandingDepositAmount.xml
.../slapos_accounting/Entity_getOutstandingDepositAmount.xml
+0
-62
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+6
-4
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+11
-8
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Entity_getOutstandingDepositAmount.py
deleted
100644 → 0
View file @
f1dc41ed
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
portal
=
context
.
getPortalObject
()
ledger_uid
=
portal
.
portal_categories
.
ledger
.
automated
.
getUid
()
if
not
currency_uid
:
raise
ValueError
(
"You must provide an currency to calculate the amount"
)
outstanding_amount_list
=
context
.
Entity_getOutstandingDepositAmountList
(
resource_uid
=
currency_uid
,
ledger_uid
=
ledger_uid
)
if
not
outstanding_amount_list
:
# Nothing found
return
0
if
len
(
outstanding_amount_list
)
>
1
:
raise
ValueError
(
'More them one value for the %s currency was found'
%
currency_uid
)
return
outstanding_amount_list
[
0
].
total_price
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Entity_getOutstandingDepositAmount.xml
deleted
100644 → 0
View file @
f1dc41ed
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
currency_uid, REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Entity_getOutstandingDepositAmount
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
7c3f0dba
...
@@ -589,7 +589,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
...
@@ -589,7 +589,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
aggregate__uid
=
service
.
getUid
(),
aggregate__uid
=
service
.
getUid
(),
simulation_state
=
simulation_state
simulation_state
=
simulation_state
)
)
self
.
assertNotEqual
(
subscription_request
,
None
)
self
.
assertNotEqual
(
subscription_request
,
None
,
"Not found subscription request for %s"
%
service
.
getRelativeUrl
())
return
subscription_request
return
subscription_request
def
checkInstanceAllocation
(
self
,
person_user_id
,
person_reference
,
def
checkInstanceAllocation
(
self
,
person_user_id
,
person_reference
,
...
@@ -672,8 +673,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
...
@@ -672,8 +673,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
tic
()
self
.
tic
()
amount
=
person
.
Entity_getOutstandingDepositAmoun
t
(
amount
=
sum
([
i
.
total_price
for
i
in
person
.
Entity_getOutstandingDepositAmountLis
t
(
currency
.
getUid
()
)
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())]
)
self
.
assertEqual
(
amount
,
deposit_amount
)
self
.
assertEqual
(
amount
,
deposit_amount
)
# Action to submit project subscription
# Action to submit project subscription
...
@@ -694,7 +695,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
...
@@ -694,7 +695,8 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
checkServiceSubscriptionRequest
(
instance_tree
,
'invalidated'
)
self
.
checkServiceSubscriptionRequest
(
instance_tree
,
'invalidated'
)
amount
=
person
.
Entity_getOutstandingDepositAmount
(
currency
.
getUid
())
amount
=
sum
([
i
.
total_price
for
i
in
person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
subscription_request
.
getLedgerUid
())])
self
.
assertEqual
(
0
,
amount
)
self
.
assertEqual
(
0
,
amount
)
self
.
login
(
person_user_id
)
self
.
login
(
person_user_id
)
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
7c3f0dba
...
@@ -717,7 +717,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -717,7 +717,7 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
assert
len
(
inventory_list
)
==
1
,
len
(
inventory_list
)
assert
len
(
inventory_list
)
==
1
,
len
(
inventory_list
)
assert
inventory_list
[
0
].
quantity
==
1
,
inventory_list
[
0
].
quantity
assert
inventory_list
[
0
].
quantity
==
1
,
inventory_list
[
0
].
quantity
resource_vcl
=
[
resource_vcl
=
[
#'software_release/%s' % release_variation.getRelativeUrl(),
#
'software_release/%s' % release_variation.getRelativeUrl(),
'software_type/%s'
%
type_variation
.
getRelativeUrl
()
'software_type/%s'
%
type_variation
.
getRelativeUrl
()
]
]
resource_vcl
.
sort
()
resource_vcl
.
sort
()
...
@@ -817,7 +817,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -817,7 +817,6 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
sale_supply
.
validate
()
sale_supply
.
validate
()
self
.
tic
()
self
.
tic
()
# some preparation
# some preparation
self
.
logout
()
self
.
logout
()
...
@@ -855,13 +854,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -855,13 +854,14 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
# format the compute_nodes
# format the compute_nodes
self
.
formatComputeNode
(
public_server
)
self
.
formatComputeNode
(
public_server
)
self
.
logout
()
self
.
logout
()
self
.
login
(
project_owner_person
.
getUserId
())
self
.
login
(
project_owner_person
.
getUserId
())
# Pay deposit to validate virtual master.
# Pay deposit to validate virtual master + one computer
deposit_amount
=
42.0
+
99.0
deposit_amount
=
42.0
+
99.0
amount
=
project_owner_person
.
Entity_getOutstandingDepositAmount
(
ledger
=
self
.
portal
.
portal_categories
.
ledger
.
automated
currency
.
getUid
())
amount
=
sum
([
i
.
total_price
for
i
in
project_owner_person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
ledger
.
getUid
())])
self
.
assertEqual
(
amount
,
deposit_amount
)
self
.
assertEqual
(
amount
,
deposit_amount
)
def
wrapWithShadow
(
_person
,
*
arg
):
def
wrapWithShadow
(
_person
,
*
arg
):
...
@@ -879,9 +879,12 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
...
@@ -879,9 +879,12 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
self
.
login
(
project_owner_person
.
getUserId
())
self
.
login
(
project_owner_person
.
getUserId
())
amount
=
project_owner_person
.
Entity_getOutstandingDepositAmount
(
currency
.
getUid
())
amount
=
sum
([
i
.
total_price
for
i
in
project_owner_person
.
Entity_getOutstandingDepositAmountList
(
currency
.
getUid
(),
ledger_uid
=
ledger
.
getUid
())])
self
.
assertEqual
(
0
,
amount
)
self
.
assertEqual
(
0
,
amount
)
self
.
logout
()
# join as the another visitor and request software instance on public
# join as the another visitor and request software instance on public
# compute_node
# compute_node
self
.
logout
()
self
.
logout
()
...
...
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