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
16
Merge Requests
16
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
b30098ba
Commit
b30098ba
authored
Sep 11, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: speed up the first invoice creation
It should reduce number of open order expand calls.
parent
bcdbf6a1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/interaction_OpenSaleOrder_validate.xml
...teraction_workflow/interaction_OpenSaleOrder_validate.xml
+1
-1
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerUpdateOpenOrderSimulation.py
..._workflow/script_Base_triggerUpdateOpenOrderSimulation.py
+0
-1
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_OpenSaleOrder_triggerUpdateOpenOrderSimulation.py
.../script_OpenSaleOrder_triggerUpdateOpenOrderSimulation.py
+15
-0
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_OpenSaleOrder_triggerUpdateOpenOrderSimulation.xml
...script_OpenSaleOrder_triggerUpdateOpenOrderSimulation.xml
+1
-1
No files found.
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/interaction_OpenSaleOrder_validate.xml
View file @
b30098ba
...
...
@@ -10,7 +10,7 @@
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
after_script/portal_workflow/slapos_simulation_interaction_workflow/script_
Base
_triggerUpdateOpenOrderSimulation
</string>
<string>
after_script/portal_workflow/slapos_simulation_interaction_workflow/script_
OpenSaleOrder
_triggerUpdateOpenOrderSimulation
</string>
</tuple>
</value>
</item>
...
...
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_Base_triggerUpdateOpenOrderSimulation.py
deleted
100644 → 0
View file @
bcdbf6a1
return
state_change
[
'object'
].
Base_reindexAndSenseAlarm
([
'update_open_order_simulation'
])
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_OpenSaleOrder_triggerUpdateOpenOrderSimulation.py
0 → 100644
View file @
b30098ba
from
DateTime
import
DateTime
open_sale_order
=
state_change
[
'object'
]
tag
=
'script_Base_triggerCreateHostingSubscriptionSimulation'
current_date
=
DateTime
()
# Prevent creating empty applied rule if not simulation movement
# will be created
# Sadly, this is probably nearly for tests which freeze date
start_date
=
open_sale_order
.
getStartDate
()
if
(
start_date
is
not
None
)
and
(
start_date
<
current_date
):
for
open_order_line
in
open_sale_order
.
objectValues
():
for
ob
in
[
open_order_line
]
+
open_order_line
.
getCellValueList
():
for
item
in
ob
.
getAggregateValueList
(
portal_type
=
'Hosting Subscription'
):
ob
.
reindexObject
(
activate_kw
=
{
'tag'
:
tag
})
item
.
activate
(
after_tag
=
tag
,
activity
=
'SQLQueue'
).
Base_reindexAndSenseAlarm
([
'slapos_accounting_create_hosting_subscription_simulation'
])
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_
Base
_triggerUpdateOpenOrderSimulation.xml
→
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_simulation_interaction_workflow/script_
OpenSaleOrder
_triggerUpdateOpenOrderSimulation.xml
View file @
b30098ba
...
...
@@ -60,7 +60,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_
Base
_triggerUpdateOpenOrderSimulation
</string>
</value>
<value>
<string>
script_
OpenSaleOrder
_triggerUpdateOpenOrderSimulation
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
...
...
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