Wednesday, February 22, 2017
1 change · master
Code cleanup and technical improvements
This update reorganizes how Odoo prepares and tracks database structures behind the scenes. It makes model setup more extensible and efficient, reducing maintenance complexity and improving startup or upgrade reliability without changing everyday user workflows.
Original PR description
Goal: - make each field responsible for its database implementation; - make reflection models (`ir.model.*`) fully extensible, and remove their bootstrapping in `base.sql`; - make the code cleaner. How: - refactor method `BaseModel._auto_init` to delegate schema updates to fields; - remove `BaseModel._auto_end`, and replace it by a generic mechanism; - move SQL code from private methods in `BaseModel` to reusable functions; - add/improve methods to reflect models, fields, constraints and relations. Extra: - improve schema creation performance by removing most `cr.commit()` spread all around the code.