upgrade-removed-recordset-methods (U1712)#

A recordset method deprecated in 16.0 and removed in 17.0.

Applies to Odoo 17.0 and later.

What it does#

Reports calls to flush(), invalidate_cache(), recompute(), refresh(), get_xml_id(), fields_get_keys() and fields_view_get() on self or records. (fields_view_get overrides are U1611.)

Why is this bad?#

Odoo 17.0 removed them: the call raises AttributeError.

Fix safety#

Safe without arguments: flush() and recompute() become env.flush_all(), invalidate_cache() and refresh() become env.invalidate_all(), get_xml_id() becomes get_external_id() and x.fields_get_keys() becomes list(x._fields). With arguments (field names, ids), choose between the model and recordset variants by hand.