odoo/odoo#82727

Created by Framework (ORM), Rémy Voet (ryv)
Merged at 5fb6200f46e21a6d1920c2ed200780aa06cddec1

Statuses:

Linked pull requests
label
odoo-dev:master-clean-sequence-format-ryv
head
7c4eba66ccf3e8162326cb30d95e852cffe1047f
merged
3 years ago by Framework (ORM), Raphael Collet
odoo/odoo odoo/upgrade
master #82727 #3194

Remove old features `_sequence`/`format_column`/`deprecated` and refactor `_write`

Several changes to simplify CRUD, to avoid maintain unused feature and to be able to make a clean bulk insert (PR: #80961)

[REM] base: remove _sequence attribute of BaseModel

The _sequence was only used for the insertion of data in the DB for
the id value. But in Odoo, the id is always a SERIAL, then the
PostgreSQL fill already the value by the right SQL sequence. Then,
avoid doing the job of the DB by ourselves.
Sadly, we need to manage the case when we create an empty record to
always get a valid query.

[REM] base: remove column_format of Field class

The column_format of the Field class was unused and create useless
noise in the ORM. Then remove it and simplify some flows.

[REF] base: simplify the _write

Issue:
_write checked that the number of modified row in DB was equal to the
number of ids in the RecordSet (raise MissingError if not).
This behavior was only used by the ORM to retry
(with exists() on the RecordSet before) if the Missing Error raised.
Then it makes the job a second time (for no reason).

Then:
- Remove the check of number of row (and simplify the call of _write)
- Remove the useless return value (always True)
- Remove the set( before the split_for_in_conditions, it adds
randomness for nothing because the _write should be call without
duplicate id (even if it is not the case, we don't care).

[REM] base: remove deprecated field attribute

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.

odoo/upgrade#3194
task-2735546