Skip to content

Commit ad5347a

Browse files
committed
[IMP] records.delete_unused: Change default of keep_xmlids
Changing the default kwarg value so the xmlids get deleted even if the record is kept, starting from version `saas~18.1` to keep the current behaviour. closes #217 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 6e8249e commit ad5347a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util/records.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,12 +1214,13 @@ def delete_unused(cr, *xmlids, **kwargs):
12141214
:param bool deactivate: whether to deactivate records that cannot be removed because
12151215
they are referenced, `False` by default
12161216
:param bool keep_xmlids: whether to keep the xml_ids of records that cannot be
1217-
removed, `True` by default
1217+
removed. By default `True` for versions up to 18.0,
1218+
`False` from `saas~18.1` on.
12181219
:return: list of ids of removed records, if any
12191220
:rtype: list(int)
12201221
"""
12211222
deactivate = kwargs.pop("deactivate", False)
1222-
keep_xmlids = kwargs.pop("keep_xmlids", True)
1223+
keep_xmlids = kwargs.pop("keep_xmlids", not version_gte("saas~18.1"))
12231224
if kwargs:
12241225
raise TypeError("delete_unused() got an unexpected keyword argument %r" % kwargs.popitem()[0])
12251226

0 commit comments

Comments
 (0)