Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ayush Tiwari
erp5
Commits
9f829522
Commit
9f829522
authored
Jul 15, 2016
by
Ayush Tiwari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_catalog: Add constructor method for adding ERP5 SQL Method objects
parent
afc2e4d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
product/ERP5/Document/SQLMethod.py
product/ERP5/Document/SQLMethod.py
+22
-3
product/ERP5/__init__.py
product/ERP5/__init__.py
+2
-1
No files found.
product/ERP5/Document/SQLMethod.py
View file @
9f829522
...
...
@@ -35,14 +35,31 @@ from Products.ERP5Type.XMLObject import XMLObject
from
Products.PythonScripts.PythonScript
import
\
PythonScript
as
ZopePythonScript
from
Products.ZSQLMethods.SQL
import
SQL
as
ZSQL
from
Products.ZSQLMethods.SQL
import
manage_addZSQLMethodForm
# Migration function
def
migrateSQLMethodToERP5Object
(
self
,
id
,
title
=
''
):
pass
manage_addSQLMethodForm
=
manage_addZSQLMethodForm
# New ZSQLMethod addition function
def
addSQLMethod
(
self
,
id
,
title
=
''
):
pass
def
addSQLMethod
(
self
,
id
,
title
=
''
,
REQUEST
=
None
,
*
args
,
**
kw
):
"""
Add ERP5 SQL Method to the folder
"""
id
=
str
(
id
)
title
=
str
(
title
)
c
=
SQLMethod
(
id
,
title
,
self
)
self
.
_setObject
(
id
,
c
)
c
=
self
.
_getOb
(
id
)
if
REQUEST
is
not
None
:
REQUEST
[
'RESPONSE'
].
redirect
(
'manage_main'
)
return
c
class
SQLMethod
(
XMLObject
,
ZSQL
):
"""SQLMethod for ERP5.
...
...
@@ -50,11 +67,13 @@ class SQLMethod(XMLObject, ZSQL):
meta_type
=
'ERP5 SQL Method'
portal_type
=
'SQL Method'
icon
=
None
# Declarative security
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
constructors
=
(
manage_addSQLMethodForm
,
addSQLMethod
)
#View content list, Force /view, Standart option in python scripts
manage_options
=
(
XMLObject
.
manage_options
[
0
],
{
'icon'
:
''
,
'label'
:
'View'
,
'action'
:
'view'
})
\
...
...
@@ -75,4 +94,4 @@ class SQLMethod(XMLObject, ZSQL):
XMLObject
.
__init__
(
self
,
*
args
,
**
kw
)
ZSQL
.
__init__
(
self
,
*
args
,
**
kw
)
InitializeClass
(
SQLMethod
)
\ No newline at end of file
#InitializeClass(SQLMethod)
\ No newline at end of file
product/ERP5/__init__.py
View file @
9f829522
...
...
@@ -53,9 +53,10 @@ from Tool import CategoryTool, SimulationTool, RuleTool, IdTool, TemplateTool,\
ConversionTool
,
RoundingTool
,
UrlRegistryTool
,
InterfaceTool
,
\
CertificateAuthorityTool
,
InotifyTool
,
TaskDistributionTool
import
ERP5Site
from
Document
import
PythonScript
from
Document
import
PythonScript
,
SQLMethod
object_classes
=
(
ERP5Site
.
ERP5Site
,
PythonScript
.
PythonScriptThroughZMI
,
SQLMethod
.
SQLMethod
,
)
portal_tools
=
(
CategoryTool
.
CategoryTool
,
SimulationTool
.
SimulationTool
,
...
...
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