Rework warnings configuration and fix some warnings

Make sure we see *all* warnings, both in the tests and in the logfile in production.

Fix many warnings by updating imports and calls to deprecated APIs

See merge request !1879
1 job for master in 0 seconds
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-Master

00:51:34