New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9.0] [IMP] Web Environment Ribbon: support variables in ribbon name (eg db_name) #621
Conversation
This commit adds a simple bakend to facilitate inheritance
This commit adds the database name under the ribbon name, in the ribbon
Isn't the dbname already shown next to the legged in user (as long as you are in debug mode)? |
@dreispt Yes, indeed, in debug mode. But we would like to see it without enabling the debug mode. |
if (strColor && validStrColour(strColor)) { | ||
ribbon.css('color', strColor); | ||
// Ribbon color | ||
if (ribbon_data.color && validStrColour(ribbon_data.color)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasBinsfeld maybe an else here for a default color if something goes wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zakiuu Hi. It's the behavior before my PR. If it's an issue, we should fix it in a separate PR.
if (strBackgroundColor && validStrColour(strBackgroundColor)) { | ||
ribbon.css('background-color', strBackgroundColor); | ||
// Ribbon background color | ||
if (ribbon_data.background_color && validStrColour(ribbon_data.background_color)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasBinsfeld samething here
# Add the database name to the ribbon name | ||
db_name = self.env.cr.dbname | ||
name = u"{name}<br/>({db_name})".format( | ||
name=ir_config_model.get_param('ribbon.name'), db_name=db_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThomasBinsfeld what I had in mind was
name = ir_config_model.get_param('ribbon.name')
name = name.format(db_name=db_name)
So the format can be completely determined in the configuration file.
And put this bit in a separate method that is easy to override.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbidoul Done !
top: 25px; | ||
left: -50px; | ||
left: -100px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we leave the ribbon size untouched in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to display on two lines, we have to change the size.
@ThomasBinsfeld LGTM. Can you please update the README with the new feature and an example using db_name? |
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
…(eg db_name) (OCA#621) * [ADD] .eggs in gitignore * [IMP] Web Environment Ribbon: add backend This commit adds a simple bakend to facilitate inheritance * [IMP] Web Environment Ribbon: add the databse name This commit adds the database name under the ribbon name, in the ribbon * [IMP] Web Environment Ribbon: prepare method for ribbon name * [IMP] README: explain how to use db_name
web_environment_ribbon
get_environment_ribbon()
can be overridden to change the standard behavior(Preview on Odoo 9.0 Enterprise)
This PR is an other solution for #588