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
4e99e918
Commit
4e99e918
authored
Feb 28, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
Updates for consistency table
See merge request
nexedi/slapos.core!493
parents
133bd4bd
e24c1c65
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
151 deletions
+16
-151
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_consistency.sql
...ortal_catalog/erp5_mysql_innodb/z_catalog_consistency.sql
+7
-14
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_consistency.xml
...ortal_catalog/erp5_mysql_innodb/z_catalog_consistency.xml
+2
-2
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_consistency.sql
...portal_catalog/erp5_mysql_innodb/z_create_consistency.sql
+2
-1
master/bt5/slapos_mysql_innodb_catalog/TestTemplateItem/portal_components/test.erp5.testSlapOSCatalogConsistency.py
...rtal_components/test.erp5.testSlapOSCatalogConsistency.py
+2
-110
master/bt5/slapos_mysql_innodb_catalog/TestTemplateItem/portal_components/test.erp5.testSlapOSCatalogConsistency.xml
...tal_components/test.erp5.testSlapOSCatalogConsistency.xml
+3
-24
No files found.
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_consistency.sql
View file @
4e99e918
DELETE
FROM
consistency
WHERE
<
dtml
-
in
uid
>
uid
=<
dtml
-
sqlvar
sequence
-
item
type
=
"int"
><
dtml
-
if
sequence
-
end
><
dtml
-
else
>
OR
</
dtml
-
if
>
</
dtml
-
in
>
;
<
dtml
-
var
"'
\0
'"
>
INSERT
INTO
REPLACE
INTO
consistency
(
`uid`
,
`consistency_error`
)
VALUES
<
dtml
-
in
prefix
=
"loop"
expr
=
"_.range(_.len(uid))"
>
(
<
dtml
-
sqlvar
expr
=
"uid[loop_item]"
type
=
"int"
>
,
<
dtml
-
sqlvar
expr
=
"int(len(checkConsistency[loop_item]) > 0)"
type
=
"int"
>
<
dtml
-
sqlvar
expr
=
"int(
(checkConsistency[loop_item] is None) or
len(checkConsistency[loop_item]) > 0)"
type
=
"int"
>
)
<
dtml
-
if
sequence
-
end
><
dtml
-
else
>
,
</
dtml
-
if
>
<
dtml
-
if
sequence
-
end
>
<
dtml
-
else
>
,
</
dtml
-
if
>
</
dtml
-
in
>
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_consistency.xml
View file @
4e99e918
...
...
@@ -43,13 +43,13 @@ checkConsistency</string> </value>
</item>
<item>
<key>
<string>
expression
</string>
</key>
<value>
<string>
python: context.get
PortalType() in ["Sale Invoice Transaction", "Subscription Request"]
</string>
</value>
<value>
<string>
python: context.get
RelativeUrl().count(\'/\') == 1
</string>
</value>
</item>
<item>
<key>
<string>
expression_cache_key
</string>
</key>
<value>
<tuple>
<string>
portal_type
</string>
<string>
relative_url
</string>
</tuple>
</value>
</item>
...
...
master/bt5/slapos_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_create_consistency.sql
View file @
4e99e918
CREATE
TABLE
`consistency`
(
`uid`
BIGINT
UNSIGNED
NOT
NULL
,
`consistency_error`
BOOL
DEFAULT
0
,
PRIMARY
KEY
(
`uid`
,
`consistency_error`
)
PRIMARY
KEY
(
`uid`
),
KEY
`consistency_error`
(
`consistency_error`
)
)
ENGINE
=
InnoDB
;
master/bt5/slapos_mysql_innodb_catalog/TestTemplateItem/portal_components/test.erp5.testSlapOSCatalogConsistency.py
View file @
4e99e918
...
...
@@ -34,7 +34,7 @@ class TestSlapOSCatalogConsistency(SlapOSTestCaseMixin):
def
afterSetUp
(
self
):
SlapOSTestCaseMixin
.
afterSetUp
(
self
)
def
test
SaleInvoiceTransaction
(
self
):
def
test
Document
(
self
):
from
Products.ERP5Type.Base
import
Base
sale_invoice_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
...
...
@@ -86,111 +86,3 @@ class TestSlapOSCatalogConsistency(SlapOSTestCaseMixin):
self
.
assertEqual
(
document
,
None
)
finally
:
Base
.
checkConsistency
=
original_checkConsistency
\ No newline at end of file
def
testSubscriptionRequest
(
self
):
from
Products.ERP5Type.Base
import
Base
subscription_request
=
self
.
portal
.
subscription_request_module
.
newContent
(
portal_type
=
"Subscription Request"
)
original_checkConsistency
=
Base
.
checkConsistency
Base
.
checkConsistency
=
checkConsistencyWithoutError
try
:
transaction
.
commit
()
subscription_request
.
immediateReindexObject
()
self
.
tic
()
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Subscription Request"
,
consistency_error
=
0
,
uid
=
subscription_request
.
getUid
()
)
self
.
assertEqual
(
document
,
subscription_request
)
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Subscription Request"
,
consistency_error
=
1
,
uid
=
subscription_request
.
getUid
()
)
self
.
assertEqual
(
document
,
None
)
Base
.
checkConsistency
=
checkConsistencyWithError
transaction
.
commit
()
subscription_request
.
immediateReindexObject
()
self
.
tic
()
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Subscription Request"
,
consistency_error
=
1
,
uid
=
subscription_request
.
getUid
()
)
self
.
assertEqual
(
document
,
subscription_request
)
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Subscription Request"
,
consistency_error
=
0
,
uid
=
subscription_request
.
getUid
(),
)
self
.
assertEqual
(
document
,
None
)
finally
:
Base
.
checkConsistency
=
original_checkConsistency
def
testNotIndexedOnConsistencyTable
(
self
):
from
Products.ERP5Type.Base
import
Base
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
"Person"
)
original_checkConsistency
=
Base
.
checkConsistency
Base
.
checkConsistency
=
checkConsistencyWithoutError
try
:
transaction
.
commit
()
person
.
immediateReindexObject
()
self
.
tic
()
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
consistency_error
=
0
,
uid
=
person
.
getUid
()
)
self
.
assertEqual
(
document
,
None
)
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
consistency_error
=
1
,
uid
=
person
.
getUid
()
)
self
.
assertEqual
(
document
,
None
)
Base
.
checkConsistency
=
checkConsistencyWithError
transaction
.
commit
()
person
.
immediateReindexObject
()
self
.
tic
()
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
consistency_error
=
1
,
uid
=
person
.
getUid
()
)
self
.
assertEqual
(
document
,
None
)
document
=
self
.
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
"Person"
,
consistency_error
=
0
,
uid
=
person
.
getUid
(),
)
self
.
assertEqual
(
document
,
None
)
finally
:
Base
.
checkConsistency
=
original_checkConsistency
\ No newline at end of file
master/bt5/slapos_mysql_innodb_catalog/TestTemplateItem/portal_components/test.erp5.testSlapOSCatalogConsistency.xml
View file @
4e99e918
...
...
@@ -6,12 +6,6 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCatalogConsistency
</string>
</value>
...
...
@@ -61,28 +55,13 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -95,7 +74,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -104,7 +83,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
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