Skip to content
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

[14.0][ADD] New module web_custom_label #2801

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

majouda
Copy link

@majouda majouda commented Apr 19, 2024

This module allows you to easily modify the labels of a field without
any development.

The module allows you to modify :

  • Label
  • Placeholder
  • Selection Options
  • Field Help

Exemple:
As a simple user of the system, I want to rename the label "Internal Reference" to "SKU".
I can easily use the custom labels menu to create a record that will do the job without any développement.

custom_field_list

@TumbaoJu
Copy link

TumbaoJu commented May 2, 2024

@OCA/web-maintainers : Here is the module presented in the last OCA Days regarding the customization of label, helper, placeholder...

Thank you for your review.

FYI : @majouda @ahmedtrigui

@etobella
Copy link
Member

etobella commented May 3, 2024

@majouda some screenshots of the module and a standard description on the description of the PR would be great

@abenzbiria
Copy link

Hi @etobella ,

Thank you for your feedback. The description and screenshots of the module are located in the readme folder. Do you want us to add more details?

cc @majouda @ahmedtrigui cc @TumbaoJu

@etobella
Copy link
Member

etobella commented May 3, 2024

Here would be a great point for starting.

image

It is great to include the information on the readme, but we should remember that contributors are doing this on their free time. We need to make it easy for them to review. Otherwise, we don't know if the module is interesting and people might ignore the PR. I am just trying to help you on this 😄

@abenzbiria
Copy link

Hi @etobella
I really appreciate the attention you're giving to this PR. Thanks again for your help. What should we do to make this PR more understandable for the reviewers?

Should we add a description here in the comments along with some screenshots?

@etobella
Copy link
Member

etobella commented May 3, 2024

Yes, this way we all can see if it is intersting to us, otherwise, we need to dig in the module

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.

please move the changes to web_custom_modifier into a separate commit, or better a separate PR

from typing import List, Mapping


def set_custom_labels_on_fields(labels: List[dict], fields: Mapping[str, dict]):
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to move all those functions into some abstract model, or move them into the base model with some prefix like _web_custom_label - your current approach makes it more difficult than necessary to change the behavior of this module (ORM and type hints mix just fine)

return arch_with_custom_labels, name_manager


def _add_custom_labels_to_view_arch(labels, arch):
Copy link
Member

Choose a reason for hiding this comment

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

same here, just some function is much harder to override than model functions

@ahmedtrigui
Copy link

ahmedtrigui commented May 6, 2024

Hi @etobella
@OCA/web-maintainers
In community edition, there's no way to edit the label except through development. So this module allows you to customize the label of the field.

in addition, not only the label can be customized, but the placeholder, a selction field and a help for a field can alos be edited.

The module is userfriendly, the customer can make changes by himself. No technical skills are needed.

Please find attached an exmple of edited field label.
Capture d’écran du 2024-05-06 11-19-32
Capture d’écran du 2024-05-06 11-19-47

FYI @abenzbiria @TumbaoJu

@majouda
Copy link
Author

majouda commented May 24, 2024

Here would be a great point for starting.

image

It is great to include the information on the readme, but we should remember that contributors are doing this on their free time. We need to make it easy for them to review. Otherwise, we don't know if the module is interesting and people might ignore the PR. I am just trying to help you on this 😄

Done, thank you for your feedback.

@TumbaoJu
Copy link

@OCA/website-maintainers : All checks have passed. Can you review it and merge if everything is ok.
Thank you in advance!

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.

None yet

6 participants