Unverified Commit 8e6b0138 authored by Stéphane Bidoul (ACSONE)'s avatar Stéphane Bidoul (ACSONE)
Browse files

[IMP] ribbon: better extensibility

parent f155fcd5
......@@ -10,12 +10,17 @@ class WebEnvironmentRibbonBackend(models.AbstractModel):
_name = 'web.environment.ribbon.backend'
_description = 'Web Environment Ribbon Backend'
@api.model
def _prepare_ribbon_format_vals(self):
return {
'db_name': self.env.cr.dbname,
}
@api.model
def _prepare_ribbon_name(self):
db_name = self.env.cr.dbname
name = self.env['ir.config_parameter'].get_param('ribbon.name')
name = name.format(db_name=db_name)
return name
name_tmpl = self.env['ir.config_parameter'].get_param('ribbon.name')
vals = self._prepare_ribbon_format_vals()
return name_tmpl.format(**vals)
@api.model
def get_environment_ribbon(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment