[REM] core: remove mutable default for parameters
Part-of: odoo/odoo#83687
This commit is contained in:
committed by
Raphael Collet
parent
a31cbaf639
commit
8a1302a502
@@ -1400,7 +1400,9 @@ class UsersView(models.Model):
|
||||
return res
|
||||
|
||||
@api.model
|
||||
def new(self, values={}, origin=None, ref=None):
|
||||
def new(self, values=None, origin=None, ref=None):
|
||||
if values is None:
|
||||
values = {}
|
||||
values = self._remove_reified_groups(values)
|
||||
user = super().new(values=values, origin=origin, ref=ref)
|
||||
group_multi_company = self.env.ref('base.group_multi_company', False)
|
||||
|
||||
+3
-1
@@ -5727,7 +5727,7 @@ Fields:
|
||||
#
|
||||
|
||||
@api.model
|
||||
def new(self, values={}, origin=None, ref=None):
|
||||
def new(self, values=None, origin=None, ref=None):
|
||||
""" new([values], [origin], [ref]) -> record
|
||||
|
||||
Return a new record instance attached to the current environment and
|
||||
@@ -5741,6 +5741,8 @@ Fields:
|
||||
One can also pass a ``ref`` value to identify the record among other new
|
||||
records. The reference is encapsulated in the ``id`` of the record.
|
||||
"""
|
||||
if values is None:
|
||||
values = {}
|
||||
if origin is not None:
|
||||
origin = origin.id
|
||||
record = self.browse([NewId(origin, ref)])
|
||||
|
||||
Reference in New Issue
Block a user