Skip to content

[18.0] web_company_color: Add button to reset colors to default.#3448

Open
javiermatos wants to merge 3 commits intoOCA:18.0from
javiermatos:add-reset-colors-to-default
Open

[18.0] web_company_color: Add button to reset colors to default.#3448
javiermatos wants to merge 3 commits intoOCA:18.0from
javiermatos:add-reset-colors-to-default

Conversation

@javiermatos
Copy link

Implements a reset to default button for web_company_color, as once a color is set, the UI does not let you reset it in order to keep using the original Odoo colors.

Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note you should call your PRs [$version] $module: $something, and also follow the Odoo git guidelines for the commit message

Co-authored-by: Holger Brunn <mail@hunki-enterprises.com>
@javiermatos javiermatos changed the title Add button to reset colors to default. [18.0] web_company_color: Add button to reset colors to default. Mar 23, 2026
@javiermatos javiermatos force-pushed the add-reset-colors-to-default branch 2 times, most recently from 2d2003b to 34e8906 Compare March 23, 2026 23:08
@javiermatos javiermatos force-pushed the add-reset-colors-to-default branch from 34e8906 to 2247c95 Compare March 23, 2026 23:12
@javiermatos
Copy link
Author

Thank you for your feedback @hbrunn , and for the link to the Odoo git guidelines. I have applied your changes and a few more that were required after it. I have written a better commit message for my last commit but not sure how to fix the rest.

Copy link
Member

@hbrunn hbrunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the followup

not sure how to fix the rest.

what do yo mean here? You should squash your commits anyways, and you can rewrite the commit message while doing so: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History

return result

def button_reset_colors(self):
self.ensure_one()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this, please remove

def write(self, values):
if not self.env.context.get("ignore_company_color", False):
fields_to_check = (
"company_colors",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha, I had already my changes from #3484 in mind when suggesting my change. Those two PRs will conflict now, if you could review that one to get it merged, you can rebase your code and remove this part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants