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
Paul Graydon
slapos.core
Commits
660cd8ec
Commit
660cd8ec
authored
Oct 26, 2018
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Preserve project consistently.
parent
5bc29225
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/ComputerConsumptionTioXMLFile_solveInvoicingGeneration.py
...ComputerConsumptionTioXMLFile_solveInvoicingGeneration.py
+8
-2
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_consumption/ComputerConsumptionTioXMLFile_solveInvoicingGeneration.py
View file @
660cd8ec
...
@@ -13,13 +13,14 @@ try:
...
@@ -13,13 +13,14 @@ try:
tioxml_dict
=
document
.
ComputerConsumptionTioXMLFile_parseXml
()
tioxml_dict
=
document
.
ComputerConsumptionTioXMLFile_parseXml
()
except
KeyError
:
except
KeyError
:
document
.
reject
(
comment
=
"Fail"
)
document
.
reject
(
comment
=
"Fail"
)
return
return
if
tioxml_dict
is
None
:
if
tioxml_dict
is
None
:
document
.
reject
(
comment
=
"Not usable TioXML data"
)
document
.
reject
(
comment
=
"Not usable TioXML data"
)
else
:
else
:
computer
=
context
.
getContributorValue
(
portal_type
=
"Computer"
)
computer
=
context
.
getContributorValue
(
portal_type
=
"Computer"
)
computer_project
=
computer
.
Item_getCurrentProjectValue
()
delivery_title
=
tioxml_dict
[
'title'
]
delivery_title
=
tioxml_dict
[
'title'
]
movement_list
=
[]
movement_list
=
[]
...
@@ -31,7 +32,9 @@ else:
...
@@ -31,7 +32,9 @@ else:
if
computer
.
getReference
()
==
reference
:
if
computer
.
getReference
()
==
reference
:
aggregate_value_list
=
[
computer
]
aggregate_value_list
=
[
computer
]
person
=
computer
.
getSourceAdministrationValue
(
portal_type
=
"Person"
)
person
=
computer
.
getSourceAdministrationValue
(
portal_type
=
"Person"
)
project
=
computer_project
else
:
else
:
project
=
None
# For now, else we should calculate this too.
if
reference
.
startswith
(
"slapuser"
):
if
reference
.
startswith
(
"slapuser"
):
reference
=
reference
.
replace
(
"slapuser"
,
"slappart"
)
reference
=
reference
.
replace
(
"slapuser"
,
"slappart"
)
# Find the partition / software instance / user
# Find the partition / software instance / user
...
@@ -72,7 +75,8 @@ else:
...
@@ -72,7 +75,8 @@ else:
quantity
=
movement
[
'quantity'
],
quantity
=
movement
[
'quantity'
],
aggregate_value_list
=
aggregate_value_list
,
aggregate_value_list
=
aggregate_value_list
,
resource
=
movement
[
'resource'
],
resource
=
movement
[
'resource'
],
person
=
person
.
getRelativeUrl
()
person
=
person
.
getRelativeUrl
(),
project
=
project
)
)
)
)
...
@@ -99,6 +103,8 @@ else:
...
@@ -99,6 +103,8 @@ else:
destination
=
movement
[
'person'
],
destination
=
movement
[
'person'
],
destination_decision
=
movement
[
'person'
],
destination_decision
=
movement
[
'person'
],
destination_section
=
movement
[
'person'
],
destination_section
=
movement
[
'person'
],
source_project
=
project
,
destination_project
=
project
,
resource_value
=
service
,
resource_value
=
service
,
quantity_unit
=
service
.
getQuantityUnit
(),
quantity_unit
=
service
.
getQuantityUnit
(),
)
)
...
...
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