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

[16.0] ValidationError don't apply translate using _ #165676

Closed
igoroliveira-ax4b opened this issue May 15, 2024 · 1 comment
Closed

[16.0] ValidationError don't apply translate using _ #165676

igoroliveira-ax4b opened this issue May 15, 2024 · 1 comment

Comments

@igoroliveira-ax4b
Copy link

Impacted versions: 16.0

Steps to reproduce: Develop any ValidationError using _ to translate (i18n)

Current behavior: The translate is not applied, unless I use UserError

Expected behavior: Translation of the string after _

Video/Screenshot link (optional):
image

Support ticket number submitted via odoo.com/help (optional):

@ossimantylahti
Copy link
Contributor

With all respecrt @igoroliveira-ax4b , this does not sound like Odoo defect. There are literally hundreds of raise ValidationErrors in Odoo code and their errors are translated.

For example, in addons/account/models/product.py a snippet:

raise ValidationError(_(
--
117 | "This product is already being used in posted Journal Entries.\n"

Is the module ax4b_budget developed by yourself? If so, it is at least located in incorrect location - the addons folder is for Odoo's own modules. Your custom modules should go to custom folder.

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

No branches or pull requests

3 participants