Database Size

database_size
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/18.0/database_size
VERSION
VERSION 1.0.2
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Opener B.V.
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Opener B.V.
COMMITTERS
COMMITTERSStefan Rijnhart, Weblate, OCA-git-bot, oca-ci
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:08
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base_setup
    - base
    - web
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Monitor the size of your Odoo instance.

Code Analysis

Views touched (6)
XML IDNameModelTypeStatus
ir_model_size_report_view_search ir.model.size.report search New
ir_model_size_report_view_tree ir.model.size.report list New
ir_model_size_view_form ir.model.size form New
ir_model_size_view_search ir.model.size search New
ir_model_size_view_tree ir.model.size list New
res_config_settings_view_form Database Size Settings res.config.settings block Inherits base_setup.res_config_settings_view_form
Models touched (5)

New fields (3)
  • ir_model_size_id Many2one → ir.model.size
    comodel_name='ir.model.size' index=True ondelete='cascade' required=True
  • name Char
    required=True
  • size Integer
Public methods (0)

No public methods.

New fields (3)
  • ir_model_size_id Many2one → ir.model.size
    comodel_name='ir.model.size' index=True ondelete='cascade' required=True
  • name Char
    required=True
  • size Integer
Public methods (0)

No public methods.

New fields (13)
  • attachment_size Integer
    help='Attachment Size in MB. Includes overlap of files that are also attached to other models.'
  • indexes_size Integer
    compute='_compute_indexes_size' help='Total Size of Indexes in MB' store=True string='Index Size'
  • ir_model_index_size_ids One2many → ir.model.index.size
    comodel_name='ir.model.index.size' inverse_name='ir_model_size_id' string='Indexes'
  • ir_model_relation_size_ids One2many → ir.model.relation.size
    comodel_name='ir.model.relation.size' inverse_name='ir_model_size_id' string='Relations'
  • measurement_date Date
    help="For the exact time, check the record's write_date." required=True args: 'Date of Measurement'
  • model Char
    index=True
  • model_name Char
    compute='_compute_model_name' store=True
  • relations_size Integer
    compute='_compute_relations_size' help='Total Size of many2many relations in MB' store=True string='Many2many Tables Size'
  • table_size Integer
    help='Bare Table Size in MB.' string='Bare Table Size'
  • total_database_size Integer
    compute='_compute_total_sizes' help='Total Model Size in MB. This includes many2many tables' store=True
  • total_model_size Integer
    compute='_compute_total_sizes' help='Total model size in MB. This includes attachments.' store=True
  • total_table_size Integer
    help='Total Table Size in MB. This includes indexes and toast tables'
  • tuples Integer
    help='Rows in use, including dead tuples' string='Estimated Rows'
Public methods (1)
  • read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True)
    @api.model
    Enforce that grouped results are ordered. Odoo will happily use the grouping field for ordering unless groupby is a list, and as it happens the grouping is usually passed as a list, for example: ['measurement_date:day']

New fields (22)
  • attachment_size Integer
  • diff_total_database_size Integer
    args: 'Change in Total Database Size'
  • diff_total_model_size Integer
    args: 'Change in Total Model Size'
  • historical_attachment_size Integer
  • historical_indexes_size Integer
    args: 'Historical Index Size'
  • historical_measurement_date Date
    args: 'Historical Date of Measurement'
  • historical_relations_size Integer
    args: 'Historical Many2many Tables Size'
  • historical_table_size Integer
    args: 'Historical Bare Table Size'
  • historical_total_database_size Integer
  • historical_total_model_size Integer
  • historical_total_table_size Integer
  • historical_tuples Integer
    args: 'Historical Estimated Rows'
  • indexes_size Integer
    args: 'Index Size'
  • measurement_date Date
    args: 'Date of Measurement'
  • model Char
  • model_name Char
  • relations_size Integer
    args: 'Many2many Tables Size'
  • table_size Integer
    args: 'Bare Table Size'
  • total_database_size Integer
  • total_model_size Integer
  • total_table_size Integer
  • tuples Integer
    args: 'Estimated Rows'
Public methods (3)
  • action_open_model_sizes(self)
    Open the model_sizes from the report line. At this point, the 'virtual' report record might not exist anymore so we fetch the dates from the context.
  • search(self, domain, offset=0, limit=None, order=None)
    @api.model
    Move the requested dates from the domain into the context
  • search_count(self, domain, limit=None)
    @api.model
    Move the requested dates from the domain into the context

New fields (3)
  • database_size_purge Boolean
    config_parameter='database_size.purge_enable' string='Purge Older Model Size Measurements'
  • database_size_retention_daily Integer
    config_parameter='database_size.retention_daily' default='366' help='The period of time (in days) during which the daily database size measurements are kept. If set to 0, measurements will be kept forever.' string='Keep Daily Measurements for'
  • database_size_retention_monthly Integer
    config_parameter='database_size.retention_monthly' default='0' help='The period of time (in days) during which database size measurmeents are kept of the first day of each month. If set to 0, measurements will be kept forever.' string='Keep Monthly Measurements for'
Public methods (0)

No public methods.

STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-tools
PULL REQUEST
PULL REQUEST[19.0][MIG] database_size: Migration to 19.0 (#3632)