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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
d54ccfbc
Commit
d54ccfbc
authored
Mar 29, 2012
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mergeRevision: Do not trust catalog
Signed-off-by:
Aurélien Calonne
<
aurel@nexedi.com
>
parent
11cfc320
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
product/ERP5/Document/Document.py
product/ERP5/Document/Document.py
+7
-1
No files found.
product/ERP5/Document/Document.py
View file @
d54ccfbc
...
@@ -595,6 +595,7 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
...
@@ -595,6 +595,7 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
"""
"""
document = self
document = self
if self.getReference():
if self.getReference():
invalid_validation_state_list = ('archived', 'cancelled', 'deleted')
catalog = self.getPortalObject().portal_catalog
catalog = self.getPortalObject().portal_catalog
# Find all document with same (reference, version, language)
# Find all document with same (reference, version, language)
kw = dict(portal_type=self.getPortalType(),
kw = dict(portal_type=self.getPortalType(),
...
@@ -614,7 +615,12 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
...
@@ -614,7 +615,12 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixin,
o.getVersion() == self.getVersion() and
\
o.getVersion() == self.getVersion() and
\
o.getLanguage() == self.getLanguage():
o.getLanguage() == self.getLanguage():
existing_document = o.getObject()
existing_document = o.getObject()
if existing_document.getValidationState() not in
\
invalid_validation_state_list:
break
break
else:
existing_document = None
# We found an existing document to update
# We found an existing document to update
if existing_document is not None:
if existing_document is not None:
document = existing_document
document = existing_document
...
...
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