Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Lukas Niegsch
erp5
Commits
a29afa63
Commit
a29afa63
authored
Jun 06, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invoicing: speed up InvoiceTransaction_selectInvoiceMovement
parent
37b1ac6f
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
30 deletions
+32
-30
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise.sql
..._mysql_innodb/z_related_grand_grand_parent_specialise.sql
+0
-11
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid.catalog_keys.xml
...elated_grand_grand_parent_specialise_uid.catalog_keys.xml
+0
-0
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid.sql
...ql_innodb/z_related_grand_grand_parent_specialise_uid.sql
+8
-0
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid.xml
...ql_innodb/z_related_grand_grand_parent_specialise_uid.xml
+8
-7
bt5/erp5_invoicing/CatalogRelatedKeyTemplateItem/related_key_list.xml
...oicing/CatalogRelatedKeyTemplateItem/related_key_list.xml
+1
-2
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_selectInvoiceMovement.py
...rp5_invoicing/InvoiceTransaction_selectInvoiceMovement.py
+13
-7
bt5/erp5_invoicing/bt/template_catalog_method_id_list
bt5/erp5_invoicing/bt/template_catalog_method_id_list
+1
-1
bt5/erp5_invoicing/bt/template_catalog_related_key_list
bt5/erp5_invoicing/bt/template_catalog_related_key_list
+1
-2
No files found.
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise.sql
deleted
100644 → 0
View file @
37b1ac6f
<
dtml
-
var
table_0
>
.
base_category_uid
=
<
dtml
-
var
"portal_categories.specialise.getUid()"
>
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_0
>
.
uid
=
<
dtml
-
var
table_2
>
.
parent_uid
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_2
>
.
uid
=
<
dtml
-
var
table_1
>
.
parent_uid
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_3
>
.
uid
=
<
dtml
-
var
table_0
>
.
category_uid
AND
<
dtml
-
var
table_1
>
.
uid
=
<
dtml
-
var
query_table
>
.
parent_uid
\ No newline at end of file
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise.catalog_keys.xml
→
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise
_uid
.catalog_keys.xml
View file @
a29afa63
File moved
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid.sql
0 → 100644
View file @
a29afa63
<
dtml
-
var
table_1
>
.
uid
=
<
dtml
-
var
table_0
>
.
parent_uid
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_2
>
.
uid
=
<
dtml
-
var
table_1
>
.
parent_uid
AND
<
dtml
-
var
table_2
>
.
base_category_uid
=
<
dtml
-
var
"portal_categories.specialise.getUid()"
>
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_0
>
.
uid
=
<
dtml
-
var
query_table
>
.
parent_uid
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise.xml
→
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise
_uid
.xml
View file @
a29afa63
...
@@ -8,16 +8,13 @@
...
@@ -8,16 +8,13 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
allow_simple_one_argument_traversal
</string>
</key>
<key>
<string>
allow_simple_one_argument_traversal
</string>
</key>
<value>
<value>
<int>
0
</int>
</value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
arguments_src
</string>
</key>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string>
table_0\n
<value>
<string>
table_0\n
table_1\n
table_1\n
table_2\n
table_2\n
table_3\n
RELATED_QUERY_SEPARATOR=" AND "\n
RELATED_QUERY_SEPARATOR=" AND "\n
query_table="catalog"
</string>
</value>
query_table="catalog"
</string>
</value>
</item>
</item>
...
@@ -27,11 +24,15 @@ query_table="catalog"</string> </value>
...
@@ -27,11 +24,15 @@ query_table="catalog"</string> </value>
</item>
</item>
<item>
<item>
<key>
<string>
class_file_
</string>
</key>
<key>
<string>
class_file_
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
class_name_
</string>
</key>
<key>
<string>
class_name_
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
connection_hook
</string>
</key>
<key>
<string>
connection_hook
</string>
</key>
...
@@ -45,7 +46,7 @@ query_table="catalog"</string> </value>
...
@@ -45,7 +46,7 @@ query_table="catalog"</string> </value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
z_related_grand_grand_parent_specialise
</string>
</value>
<value>
<string>
z_related_grand_grand_parent_specialise
_uid
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
max_cache_
</string>
</key>
<key>
<string>
max_cache_
</string>
</key>
...
...
bt5/erp5_invoicing/CatalogRelatedKeyTemplateItem/related_key_list.xml
View file @
a29afa63
<key_list>
<key_list>
<key>
grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent
</key>
<key>
grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent
</key>
<key>
grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise
</key>
<key>
grand_grand_parent_specialise_uid | catalog,catalog,category/category_uid/z_related_grand_grand_parent_specialise_uid
</key>
<key>
grand_grand_parent_specialise_reference | category,catalog,catalog,catalog/reference/z_related_grand_grand_parent_specialise
</key>
</key_list>
</key_list>
\ No newline at end of file
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_selectInvoiceMovement.py
View file @
a29afa63
...
@@ -3,11 +3,16 @@
...
@@ -3,11 +3,16 @@
Simulation Movements can come from normal Invoice Transaction Rule
Simulation Movements can come from normal Invoice Transaction Rule
and same rule which is children of Trade Model Rule """
and same rule which is children of Trade Model Rule """
portal
=
context
.
getPortalObject
()
searchRules
=
portal
.
portal_rules
.
searchFolder
getRuleUidList
=
lambda
*
args
:
[
x
.
getUid
()
for
x
in
searchRules
(
reference
=
args
)]
# search for normal movements
# search for normal movements
kw
[
'parent_specialise_reference'
]
=
[
'default_invoice_transaction_rule'
]
kw
[
'parent_specialise_uid'
]
=
getRuleUidList
(
'default_invoice_transaction_rule'
)
kw
[
'grand_grand_parent_specialise_reference'
]
=
[
'default_invoicing_rule'
,
'default_invoice_rule'
,
'default_tax_rule'
]
kw
[
'grand_grand_parent_specialise_uid'
]
=
getRuleUidList
(
if
context
.
Invoice_isAdvanced
():
'default_invoicing_rule'
,
'default_invoice_rule'
,
'default_tax_rule'
)
if
portal
.
Invoice_isAdvanced
():
kw
[
'explanation_portal_type'
]
=
[
'%s Order'
%
trade_type
,
kw
[
'explanation_portal_type'
]
=
[
'%s Order'
%
trade_type
,
'%s Invoice'
%
trade_type
,
'%s Invoice'
%
trade_type
,
'%s Packing List'
%
trade_type
,
'%s Packing List'
%
trade_type
,
...
@@ -27,13 +32,14 @@ kw['group_by'] = ('uid',)
...
@@ -27,13 +32,14 @@ kw['group_by'] = ('uid',)
search_kw
=
kw
.
copy
()
search_kw
=
kw
.
copy
()
search_kw
[
'grand_parent_simulation_state'
]
=
[
'started'
]
search_kw
[
'grand_parent_simulation_state'
]
=
[
'started'
]
movement_list
=
list
(
context
.
portal_catalog
(
**
search_kw
))
movement_list
=
list
(
portal
.
portal_catalog
(
**
search_kw
))
# update query to search for movements which are children of Trade Model Rule
# update query to search for movements which are children of Trade Model Rule
kw
[
'grand_grand_parent_specialise_reference'
]
=
'default_trade_model_rule'
kw
[
'grand_grand_parent_specialise_uid'
]
=
getRuleUidList
(
'default_trade_model_rule'
)
kw
[
'grand_grand_grand_parent_simulation_state'
]
=
[
'started'
]
kw
[
'grand_grand_grand_parent_simulation_state'
]
=
[
'started'
]
movement_list
+=
list
(
context
.
portal_catalog
(
**
kw
)
)
movement_list
+=
portal
.
portal_catalog
(
**
kw
)
# Simulation movement's state maybe not yet updated, make sure it's the right one
# Simulation movement's state maybe not yet updated, make sure it's the right one
return
[
x
for
x
in
movement_list
if
x
.
getParentValue
().
getParentValue
().
getSimulationState
()
==
'started'
]
return
[
x
for
x
in
movement_list
if
x
.
getParentValue
().
getParentValue
().
getSimulationState
()
==
'started'
]
bt5/erp5_invoicing/bt/template_catalog_method_id_list
View file @
a29afa63
erp5_mysql_innodb/z_related_grand_grand_grand_parent
erp5_mysql_innodb/z_related_grand_grand_grand_parent
erp5_mysql_innodb/z_related_grand_grand_parent_specialise
erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid
\ No newline at end of file
\ No newline at end of file
bt5/erp5_invoicing/bt/template_catalog_related_key_list
View file @
a29afa63
grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent
grand_grand_grand_parent_simulation_state | catalog,catalog,catalog,catalog/simulation_state/z_related_grand_grand_grand_parent
grand_grand_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise
grand_grand_parent_specialise_uid | catalog,catalog,category/category_uid/z_related_grand_grand_parent_specialise_uid
grand_grand_parent_specialise_reference | category,catalog,catalog,catalog/reference/z_related_grand_grand_parent_specialise
\ No newline at end of file
\ No newline at end of file
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