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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
9bac9962
Commit
9bac9962
authored
Jun 06, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invoicing: speed up InvoiceTransaction_selectInvoiceMovement
parent
ad6958f4
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 @
ad6958f4
<
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 @
9bac9962
File moved
bt5/erp5_invoicing/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid.sql
0 → 100644
View file @
9bac9962
<
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 @
9bac9962
...
...
@@ -8,16 +8,13 @@
<dictionary>
<item>
<key>
<string>
allow_simple_one_argument_traversal
</string>
</key>
<value>
<none/>
</value>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
arguments_src
</string>
</key>
<value>
<string>
table_0\n
table_1\n
table_2\n
table_3\n
RELATED_QUERY_SEPARATOR=" AND "\n
query_table="catalog"
</string>
</value>
</item>
...
...
@@ -27,11 +24,15 @@ query_table="catalog"</string> </value>
</item>
<item>
<key>
<string>
class_file_
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
class_name_
</string>
</key>
<value>
<string></string>
</value>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
connection_hook
</string>
</key>
...
...
@@ -45,7 +46,7 @@ query_table="catalog"</string> </value>
</item>
<item>
<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>
<key>
<string>
max_cache_
</string>
</key>
...
...
bt5/erp5_invoicing/CatalogRelatedKeyTemplateItem/related_key_list.xml
View file @
9bac9962
<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_parent_specialise_portal_type | category,catalog,catalog,catalog/portal_type/z_related_grand_grand_parent_specialise
</key>
<key>
grand_grand_parent_specialise_reference | category,catalog,catalog,catalog/reference/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_list>
\ No newline at end of file
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_selectInvoiceMovement.py
View file @
9bac9962
...
...
@@ -3,11 +3,16 @@
Simulation Movements can come from normal Invoice Transaction 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
kw
[
'parent_specialise_reference'
]
=
[
'default_invoice_transaction_rule'
]
kw
[
'grand_grand_parent_specialise_reference'
]
=
[
'default_invoicing_rule'
,
'default_invoice_rule'
,
'default_tax_rule'
]
if
context
.
Invoice_isAdvanced
():
kw
[
'parent_specialise_uid'
]
=
getRuleUidList
(
'default_invoice_transaction_rule'
)
kw
[
'grand_grand_parent_specialise_uid'
]
=
getRuleUidList
(
'default_invoicing_rule'
,
'default_invoice_rule'
,
'default_tax_rule'
)
if
portal
.
Invoice_isAdvanced
():
kw
[
'explanation_portal_type'
]
=
[
'%s Order'
%
trade_type
,
'%s Invoice'
%
trade_type
,
'%s Packing List'
%
trade_type
,
...
...
@@ -27,13 +32,14 @@ kw['group_by'] = ('uid',)
search_kw
=
kw
.
copy
()
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
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'
]
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
return
[
x
for
x
in
movement_list
if
x
.
getParentValue
().
getParentValue
().
getSimulationState
()
==
'started'
]
bt5/erp5_invoicing/bt/template_catalog_method_id_list
View file @
9bac9962
erp5_mysql_innodb/z_related_grand_grand_grand_parent
erp5_mysql_innodb/z_related_grand_grand_parent_specialise
\ No newline at end of file
erp5_mysql_innodb/z_related_grand_grand_parent_specialise_uid
\ No newline at end of file
bt5/erp5_invoicing/bt/template_catalog_related_key_list
View file @
9bac9962
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_reference | category,catalog,catalog,catalog/reference/z_related_grand_grand_parent_specialise
\ No newline at end of file
grand_grand_parent_specialise_uid | catalog,catalog,category/category_uid/z_related_grand_grand_parent_specialise_uid
\ 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