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
Matevz Golob
erp5
Commits
cd93cec3
Commit
cd93cec3
authored
Jul 09, 2013
by
Aurel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use transactional variable to more efficient
parent
414d7fcd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
bt5/erp5_tiosafe_document/SkinTemplateItem/portal_skins/erp5_tiosafe_document/DocumentConnector_readDocument.xml
.../erp5_tiosafe_document/DocumentConnector_readDocument.xml
+13
-9
bt5/erp5_tiosafe_document/bt/revision
bt5/erp5_tiosafe_document/bt/revision
+1
-1
No files found.
bt5/erp5_tiosafe_document/SkinTemplateItem/portal_skins/erp5_tiosafe_document/DocumentConnector_readDocument.xml
View file @
cd93cec3
...
@@ -53,14 +53,18 @@
...
@@ -53,14 +53,18 @@
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
# First retrieve the document\n
# First retrieve the document\n
doc_list = context.getPortalObject().document_module.searchFolder(reference=reference,\n
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable\n
sort_on = ((\'version\', \'DESC\'),),\n
tv = getTransactionalVariable()\n
limit=1)\n
key = "%s-%s" % (context.getPath(), reference)\n
\n
try:\n
if not len(doc_list) == 1:\n
document = tv[key]\n
raise ValueError, "Impossible to find document with reference %r" %(reference)\n
except KeyError:\n
\n
document_list = portal.document_module.searchFolder(reference=reference, validation_state="shared",\n
import_file = doc_list[0]\n
sort_on=[(\'version\', \'DESC\')])\n
if len(document_list) != 1:\n
raise ValueError, "Impossible to find document with reference %s" %(reference)\n
else:\n
tv[key] = document = document_list[0].getObject()\n
\n
\n
# Then parse it\n
# Then parse it\n
from Products.ERP5OOo.OOoUtils import OOoParser\n
from Products.ERP5OOo.OOoUtils import OOoParser\n
...
@@ -102,7 +106,7 @@ def getIDFromString(string=None):\n
...
@@ -102,7 +106,7 @@ def getIDFromString(string=None):\n
\n
\n
return clean_id\n
return clean_id\n
\n
\n
parser.openFromString(str(
import_file
.getData()))\n
parser.openFromString(str(
document
.getData()))\n
\n
\n
# Extract tables from the speadsheet file\n
# Extract tables from the speadsheet file\n
filename = parser.getFilename()\n
filename = parser.getFilename()\n
...
...
bt5/erp5_tiosafe_document/bt/revision
View file @
cd93cec3
2
3
\ 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