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
Carlos Ramos Carreño
slapos.core
Commits
64b61d7a
Commit
64b61d7a
authored
Sep 21, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: Define appropriate Start Data on Movements
parent
a63fc26f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_startConfirmedAggregatedSalePackingList.py
...nting/Delivery_startConfirmedAggregatedSalePackingList.py
+4
-1
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_generateSlapOSAggregatedMovementList.py
...ting/OrderBuilder_generateSlapOSAggregatedMovementList.py
+3
-4
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_selectSlapOSAggregatedDeliveryList.py
...unting/OrderBuilder_selectSlapOSAggregatedDeliveryList.py
+5
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
.../portal_components/test.erp5.testSlapOSAccountingAlarm.py
+3
-3
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_startConfirmedAggregatedSalePackingList.py
View file @
64b61d7a
...
...
@@ -10,7 +10,10 @@ if context.getSimulationState() == 'confirmed' \
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
()]:
comment
=
'Start by alarm as all actions in confirmed state are ready.'
date
=
DateTime
().
earliestTime
()
date
=
context
.
getStartDate
()
if
date
is
None
:
date
=
DateTime
().
earliestTime
()
context
.
edit
(
start_date
=
date
,
stop_date
=
date
)
if
isTransitionPossible
(
context
,
'start'
):
context
.
start
(
comment
=
comment
)
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_generateSlapOSAggregatedMovementList.py
View file @
64b61d7a
...
...
@@ -61,8 +61,8 @@ for movement in movement_list:
destination_section
=
movement
.
getDestination
(),
destination_decision
=
movement
.
getDestination
(),
specialise
=
specialise
,
price_currency
=
movement
.
getPriceCurrency
()
)
price_currency
=
movement
.
getPriceCurrency
()
,
start_date
=
movement
.
getStartDate
()
)
# XXX Shamefully hardcoded values
if
movement
.
getResource
()
==
'service_module/slapos_instance_subscription'
:
...
...
@@ -84,8 +84,7 @@ for movement in movement_list:
if
subscription
is
not
None
:
temp_movement
.
edit
(
specialise
=
specialise_to_set
,
causality
=
subscription
,
start_date
=
movement
.
getStartDate
())
causality
=
subscription
)
elif
movement
.
getCausality
(
portal_type
=
"Subscription Request"
)
is
not
None
:
temp_movement
.
edit
(
specialise
=
specialise_to_set
,
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/OrderBuilder_selectSlapOSAggregatedDeliveryList.py
View file @
64b61d7a
...
...
@@ -13,7 +13,8 @@ def newPackingList(movement, causality, message):
destination_decision
=
movement
.
getDestination
(),
specialise
=
movement
.
getSpecialise
(),
price_currency
=
movement
.
getPriceCurrency
(),
causality
=
causality
)
causality
=
causality
,
start_date
=
movement
.
getStartDate
())
delivery
.
confirm
(
message
)
return
delivery
...
...
@@ -51,6 +52,9 @@ for movement in movement_list:
if
delivery
is
not
None
and
delivery
.
getSource
()
!=
movement
.
getSource
():
delivery
.
setSource
(
movement
.
getSource
())
if
delivery
is
not
None
and
delivery
.
getSourceSection
()
!=
movement
.
getSourceSection
():
delivery
.
setSourceSection
(
movement
.
getSourceSection
())
person_delivery_mapping
[
"%s---%s---%s"
%
(
person
.
getUid
(),
causality
,
specialise_uid
)]
=
delivery
return
person_delivery_mapping
.
values
()
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingAlarm.py
View file @
64b61d7a
...
...
@@ -1101,7 +1101,7 @@ class TestSlapOSStartConfirmedAggregatedSalePackingListAlarm(
False
,
delivery_date
=
DateTime
(
"2012/04/22"
),
accounting_date
=
DateTime
(
'2012/04/23'
))
def
test_start_date_is_resetted
(
self
):
def
test_start_date_is
nt
_resetted
(
self
):
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
"Sale Packing List"
,
start_date
=
DateTime
(
"2012/04/22"
),
...
...
@@ -1122,9 +1122,9 @@ class TestSlapOSStartConfirmedAggregatedSalePackingListAlarm(
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
delivery
,
'solved'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
delivery
,
'confirmed'
)
delivery
.
Delivery_startConfirmedAggregatedSalePackingList
()
self
.
assertEqual
(
delivery
.
getStartDate
(),
self
.
assert
Not
Equal
(
delivery
.
getStartDate
(),
DateTime
().
earliestTime
())
self
.
assertEqual
(
delivery
.
getStopDate
(),
self
.
assert
Not
Equal
(
delivery
.
getStopDate
(),
DateTime
().
earliestTime
())
self
.
assertEqual
(
delivery
.
getSimulationState
(),
'started'
)
...
...
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