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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
erp5
Commits
35c38086
Commit
35c38086
authored
Oct 11, 2017
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CopySupport: Add support for reindex_kw.
Consistently with other methods which may trigger reindexations.
parent
ba0fd479
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
product/ERP5Type/CopySupport.py
product/ERP5Type/CopySupport.py
+7
-3
No files found.
product/ERP5Type/CopySupport.py
View file @
35c38086
...
...
@@ -422,15 +422,16 @@ class CopyContainer:
path_item_list
=
previous_path
,
new_id
=
self
.
id
)
def
_duplicate
(
self
,
cp
):
def
_duplicate
(
self
,
cp
,
reindex_kw
=
None
):
_
,
result
=
self
.
__duplicate
(
cp
,
duplicate
=
True
,
is_indexable
=
None
,
reindex_kw
=
reindex_kw
,
)
return
result
def
__duplicate
(
self
,
cp
,
duplicate
,
is_indexable
):
def
__duplicate
(
self
,
cp
,
duplicate
,
is_indexable
,
reindex_kw
):
try
:
cp
=
_cb_decode
(
cp
)
except
:
...
...
@@ -490,6 +491,8 @@ class CopyContainer:
new_id
=
self
.
_get_id
(
orig_id
)
result
.
append
({
'id'
:
orig_id
,
'new_id'
:
new_id
})
new_ob
.
_setId
(
new_id
)
if
reindex_kw
is
not
None
:
new_ob
.
setDefaultReindexParameterDict
(
reindex_kw
)
if
is_indexable
is
not
None
and
not
is_indexable
:
new_ob
.
_setNonIndexable
()
self
.
_setObject
(
new_id
,
new_ob
,
set_owner
=
set_owner
)
...
...
@@ -531,7 +534,7 @@ class CopyContainer:
self
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
__recurse
(
'_setNonIndexable'
)
def
manage_pasteObjects
(
self
,
cb_copy_data
=
None
,
is_indexable
=
None
,
REQUEST
=
None
):
def
manage_pasteObjects
(
self
,
cb_copy_data
=
None
,
is_indexable
=
None
,
reindex_kw
=
None
,
REQUEST
=
None
):
"""Paste previously copied objects into the current object.
If calling manage_pasteObjects from python code, pass the result of a
...
...
@@ -552,6 +555,7 @@ class CopyContainer:
cp
,
duplicate
=
False
,
is_indexable
=
is_indexable
,
reindex_kw
=
reindex_kw
,
)
if
REQUEST
is
None
:
return
result
...
...
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