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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
erp5
Commits
bcd22bf2
Commit
bcd22bf2
authored
Sep 18, 2019
by
Nicolas Wavrant
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP
parent
7233208a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
product/CMFCategory/CategoryTool.py
product/CMFCategory/CategoryTool.py
+12
-0
product/ERP5Type/Accessor/Alias.py
product/ERP5Type/Accessor/Alias.py
+3
-0
product/ERP5Type/Accessor/Value.py
product/ERP5Type/Accessor/Value.py
+8
-0
product/ERP5Type/Base.py
product/ERP5Type/Base.py
+4
-0
No files found.
product/CMFCategory/CategoryTool.py
View file @
bcd22bf2
...
...
@@ -624,6 +624,18 @@ class CategoryTool(BaseTool):
to filter the object on
"""
"""
self = <erp5.portal_type.Category Tool object at 0x7f19b1b14758 oid 0xd7 in <Connection at 7f19b6084f10>>
context = <erp5.portal_type.Person object at 0x7f19b0065f50>
base_category_list = subordination
category_list = <erp5.portal_type.Organisation object at 0x7f19ab059d70>
base = 0
keep_default = 0
spec = ()
filter = None
checked_permission = None
kw = {'portal_type': ()}
"""
# LOG("CategoryTool, setCategoryMembership", 0 ,
# 'category_list: %s' % str(category_list))
# XXX We must use filters in the future
...
...
product/ERP5Type/Accessor/Alias.py
View file @
bcd22bf2
...
...
@@ -27,6 +27,7 @@
##############################################################################
from
Base
import
Setter
from
zLOG
import
LOG
# Creation of default constructor
class
func_code
:
pass
...
...
@@ -53,6 +54,8 @@ class Reindex(Setter):
self
.
_accessor_id
=
accessor_id
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
LOG
(
"NICOLAS-Alias"
,
0
,
instance
,
args
,
kw
)
instance
.
log
(
'NICOLAS log: %s %s %s %s'
%
(
self
,
instance
,
args
,
kw
))
method
=
getattr
(
instance
,
self
.
_accessor_id
)
modified_object_list
=
method
(
*
args
,
**
kw
)
# private methods can return a list of modified objects that this
...
...
product/ERP5Type/Accessor/Value.py
View file @
bcd22bf2
...
...
@@ -48,6 +48,8 @@ class SetSetter(BaseSetter):
self
.
_warning
=
warning
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
if
instance
.
getTitle
()
==
'NW'
:
import
pdb
;
pdb
.
set_trace
()
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Setter Id:"
,
0
,
self
.
_id
)
instance
.
_setValue
(
self
.
_key
,
set
(
args
[
0
]),
...
...
@@ -67,6 +69,8 @@ class ListSetter(SetSetter):
_need__name__
=
1
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
#if Base not in value.__class__.__mro__:
# raise TypeError('Value setter only takes ERP5 objects as parameters')
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Setter Id:"
,
0
,
self
.
_id
)
instance
.
_setValue
(
self
.
_key
,
args
[
0
],
...
...
@@ -88,6 +92,7 @@ class DefaultSetter(SetSetter):
_need__name__
=
1
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
LOG
(
"NICOLAS"
,
0
,
instance
,
*
args
,
**
kw
)
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Setter Id:"
,
0
,
self
.
_id
)
instance
.
_setDefaultValue
(
self
.
_key
,
args
[
0
],
...
...
@@ -228,6 +233,7 @@ class UidSetSetter(BaseSetter):
self
.
_warning
=
warning
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
LOG
(
"NICOLAS"
,
0
,
instance
,
*
args
,
**
kw
)
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Getter Id:"
,
0
,
self
.
_id
)
instance
.
_setValueUidList
(
self
.
_key
,
set
(
args
[
0
]),
...
...
@@ -244,6 +250,7 @@ class UidListSetter(UidSetSetter):
_need__name__
=
1
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
LOG
(
"NICOLAS"
,
0
,
instance
,
*
args
,
**
kw
)
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Getter Id:"
,
0
,
self
.
_id
)
instance
.
_setValueUidList
(
self
.
_key
,
args
[
0
],
...
...
@@ -263,6 +270,7 @@ class UidDefaultSetter(UidSetSetter):
_need__name__
=
1
def
__call__
(
self
,
instance
,
*
args
,
**
kw
):
LOG
(
"NICOLAS"
,
0
,
instance
,
*
args
,
**
kw
)
if
self
.
_warning
:
LOG
(
"ERP5Type Deprecated Getter Id:"
,
0
,
self
.
_id
)
instance
.
_setDefaultValueUid
(
self
.
_key
,
args
[
0
],
...
...
product/ERP5Type/Base.py
View file @
bcd22bf2
...
...
@@ -29,6 +29,7 @@
from
struct
import
unpack
from
copy
import
copy
import
inspect
import
warnings
import
types
import
thread
,
threading
...
...
@@ -1833,6 +1834,8 @@ class Base( CopyContainer,
# categories
def
_setValue
(
self
,
id
,
target
,
spec
=
(),
filter
=
None
,
portal_type
=
(),
keep_default
=
1
,
checked_permission
=
None
):
from
zLOG
import
LOG
LOG
(
"NICOLAS-Base_setValue"
,
0
,
id
,
target
)
getRelativeUrl
=
self
.
getPortalObject
().
portal_url
.
getRelativeUrl
def
cleanupCategory
(
path
):
...
...
@@ -2119,6 +2122,7 @@ class Base( CopyContainer,
# Private accessors for the implementation of categories
def
_setCategoryMembership
(
self
,
*
args
,
**
kw
):
self
.
log
(
'NICOLAS_setCategoryMembership'
)
self
.
_getCategoryTool
().
_setCategoryMembership
(
self
,
*
args
,
**
kw
)
#self.activate().edit() # Do nothing except call workflow method
# XXX This is a problem - it is used to circumvent a lack of edit
...
...
Nicolas Wavrant
@Nicolas
mentioned in commit
be0b1907
·
Sep 19, 2019
mentioned in commit
be0b1907
mentioned in commit be0b190705e77e71a0d4e7733636b09824769d5c
Toggle commit list
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