[REM] base: remove field attribute 'deprecated'

It was only used one time on a unused field.
We don't want to keep useless fields anymore,
the migration is done for that.

task-2735546
odoo/upgrade#3194

closes odoo/odoo#82727

Signed-off-by: Raphael Collet <rco@odoo.com>
This commit is contained in:
Rémy Voet (ryv)
2022-02-01 10:54:19 +00:00
committed by Raphael Collet
parent 3189b031a2
commit 5fb6200f46
3 changed files with 2 additions and 16 deletions
-2
View File
@@ -12,8 +12,6 @@ class Attachment(models.Model):
_inherit = "ir.attachment"
# related for backward compatibility with saas-6
website_url = fields.Char(string="Website URL", related='local_url', deprecated=True, readonly=False)
key = fields.Char(help='Technical field used to resolve multiple attachments in a multi-website environment.')
website_id = fields.Many2one('website')
+2 -4
View File
@@ -284,7 +284,6 @@ class Field(MetaField('DummyField', (object,), {})):
states = None # set readonly and required depending on state
groups = None # csv list of group xml ids
change_default = False # whether the field may trigger a "user-onchange"
deprecated = None # whether the field is deprecated
related_field = None # corresponding related field
group_operator = None # operator for aggregating values
@@ -461,8 +460,8 @@ class Field(MetaField('DummyField', (object,), {})):
self.__dict__.update(attrs)
# prefetch only stored, column, non-manual and non-deprecated fields
if not (self.store and self.column_type) or self.manual or self.deprecated:
# prefetch only stored, column, non-manual fields
if not self.store or not self.column_type or self.manual:
self.prefetch = False
if not self.string and not self.related:
@@ -812,7 +811,6 @@ class Field(MetaField('DummyField', (object,), {})):
_description_states = property(attrgetter('states'))
_description_groups = property(attrgetter('groups'))
_description_change_default = property(attrgetter('change_default'))
_description_deprecated = property(attrgetter('deprecated'))
_description_group_operator = property(attrgetter('group_operator'))
def _description_depends(self, env):
-10
View File
@@ -3382,8 +3382,6 @@ Fields:
field = self._fields[name]
if not field.column_type:
field.read(fetched)
if field.deprecated:
_logger.warning('Field %s is deprecated: %s', field, field.deprecated)
# possibly raise exception for the records that could not be read
missing = self - fetched
@@ -3950,10 +3948,6 @@ Fields:
continue
field = self._fields[name]
assert field.store
if field.deprecated:
_logger.warning('Field %s is deprecated: %s', field, field.deprecated)
assert field.column_type
columns[name] = val
@@ -4820,10 +4814,6 @@ Fields:
blacklist.update(set(self.env[parent_model]._fields) - whitelist)
else:
blacklist_given_fields(self.env[parent_model])
# blacklist deprecated fields
for name, field in model._fields.items():
if field.deprecated:
blacklist.add(name)
blacklist_given_fields(self)