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
Carlos Ramos Carreño
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:
...
@@ -422,15 +422,16 @@ class CopyContainer:
path_item_list
=
previous_path
,
path_item_list
=
previous_path
,
new_id
=
self
.
id
)
new_id
=
self
.
id
)
def
_duplicate
(
self
,
cp
):
def
_duplicate
(
self
,
cp
,
reindex_kw
=
None
):
_
,
result
=
self
.
__duplicate
(
_
,
result
=
self
.
__duplicate
(
cp
,
cp
,
duplicate
=
True
,
duplicate
=
True
,
is_indexable
=
None
,
is_indexable
=
None
,
reindex_kw
=
reindex_kw
,
)
)
return
result
return
result
def
__duplicate
(
self
,
cp
,
duplicate
,
is_indexable
):
def
__duplicate
(
self
,
cp
,
duplicate
,
is_indexable
,
reindex_kw
):
try
:
try
:
cp
=
_cb_decode
(
cp
)
cp
=
_cb_decode
(
cp
)
except
:
except
:
...
@@ -490,6 +491,8 @@ class CopyContainer:
...
@@ -490,6 +491,8 @@ class CopyContainer:
new_id
=
self
.
_get_id
(
orig_id
)
new_id
=
self
.
_get_id
(
orig_id
)
result
.
append
({
'id'
:
orig_id
,
'new_id'
:
new_id
})
result
.
append
({
'id'
:
orig_id
,
'new_id'
:
new_id
})
new_ob
.
_setId
(
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
:
if
is_indexable
is
not
None
and
not
is_indexable
:
new_ob
.
_setNonIndexable
()
new_ob
.
_setNonIndexable
()
self
.
_setObject
(
new_id
,
new_ob
,
set_owner
=
set_owner
)
self
.
_setObject
(
new_id
,
new_ob
,
set_owner
=
set_owner
)
...
@@ -531,7 +534,7 @@ class CopyContainer:
...
@@ -531,7 +534,7 @@ class CopyContainer:
self
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
isIndexable
=
ConstantGetter
(
'isIndexable'
,
value
=
False
)
self
.
__recurse
(
'_setNonIndexable'
)
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.
"""Paste previously copied objects into the current object.
If calling manage_pasteObjects from python code, pass the result of a
If calling manage_pasteObjects from python code, pass the result of a
...
@@ -552,6 +555,7 @@ class CopyContainer:
...
@@ -552,6 +555,7 @@ class CopyContainer:
cp
,
cp
,
duplicate
=
False
,
duplicate
=
False
,
is_indexable
=
is_indexable
,
is_indexable
=
is_indexable
,
reindex_kw
=
reindex_kw
,
)
)
if
REQUEST
is
None
:
if
REQUEST
is
None
:
return
result
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