Skip to content

Conversation

@ppr-odoo
Copy link
Contributor

@ppr-odoo ppr-odoo commented Sep 2, 2024

Before this commit error messages in odoo are boring and not much attractive to user. Those were like odoo is preventing them from doing something user want to do.

In this commit, we have modified the message to be a more friendly and humorous tone, making it less tedious and more enjoyable. It aims to enhance the user experience and ensure that interactions with any application are both pleasant and informative. As a result, the messages have been clear, short, easy to understand and informative.

Task link
task-3422664

@robodoo
Copy link
Contributor

robodoo commented Sep 2, 2024

Pull request status dashboard

@C3POdoo C3POdoo added the RD research & development, internal work label Sep 2, 2024
honest_move.action_post()

with self.assertRaisesRegex(UserError, 'not balanced'), self.env.cr.savepoint():
with self.assertRaisesRegex(UserError, 'unbalanced'), self.env.cr.savepoint():
Copy link
Contributor

Choose a reason for hiding this comment

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

revert this; not balanced seems better.

'!', ('company_id', 'child_of', company.id),
], limit=1):
raise UserError(_("You can't set a different company on your analytic account since there are some analytic items linked to it."))
raise UserError(_("No company-switching allowed for your analytic account while there are some linked analytic items around! It's a recipe for an analytical disaster!"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace by "You can't change the company of an analytic account having analytic items around! It's a recipe for an analytical disaster!""

raise UserError(_('Impossible number %s: too many digits.', number))
else:
raise UserError(_('Impossible number %s: probably invalid number of digits.', number))
raise UserError(_("The format of the number %s is incorrect unless you're dialing aliens! Let's fix it.", number))
Copy link
Contributor

Choose a reason for hiding this comment

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

Replace by "The phone number %s is incorrect! Let's fix it - you are not dialing aliens."

@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch from 8f8dbf4 to f073493 Compare February 26, 2025 07:24
@xavierbol xavierbol marked this pull request as ready for review February 26, 2025 12:08
@C3POdoo C3POdoo requested review from a team, aab-odoo, casp-odoo, kebeclibre, kmagusiak, ryv-odoo and svs-odoo and removed request for a team February 26, 2025 12:10
@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch 2 times, most recently from 407ecb6 to cfafbf7 Compare March 2, 2025 09:23
@ppr-odoo
Copy link
Contributor Author

ppr-odoo commented Mar 2, 2025

Hello @ticodoo @william-andre @dylankiss

I have incorporated the suggestions discussed with Jihane. Kindly let me know if anything is missing or if you have any additional suggestions

cc @xavierbol

@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch from cfafbf7 to f332521 Compare March 3, 2025 08:59
Copy link
Contributor

@william-andre william-andre left a comment

Choose a reason for hiding this comment

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

Nothing important left for the accounting scope

@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch 2 times, most recently from 1a0736c to 9576c89 Compare March 3, 2025 13:17
Copy link
Contributor

@ticodoo ticodoo left a comment

Choose a reason for hiding this comment

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

Please make sure you correctly apply all of my grammar change suggestions. I don't have time to review all of the strings again.

Comment on lines 2423 to 2424
Copy link
Contributor

Choose a reason for hiding this comment

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

missing space + grammar issue + maybe better wording?:

Suggested change
"The journal entry is not balanced,"
"with %(debit_total)s on the debit side and %(credit_total)s on the credit side. We need some equilibrium here!\n\n"
"The journal entry is not balanced, "
"with %(debit_total)s on the debit side and %(credit_total)s on the credit side, there needs to be an equilibrium!\n\n"

Copy link
Contributor

Choose a reason for hiding this comment

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

@ticodoo Maybe another suggestion?

Suggested change
"The journal entry is not balanced,"
"with %(debit_total)s on the debit side and %(credit_total)s on the credit side. We need some equilibrium here!\n\n"
"The journal entry is not balanced. "
"With %(debit_total)s on the debit side and %(credit_total)s on the credit side, we've disrupted the equilibrium!\n\n"

Copy link
Contributor

Choose a reason for hiding this comment

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

"we've disrupted the equilibrium" sounds a bit weird here. The comma/period change is fine. Doesn't really make a difference

Copy link
Contributor

Choose a reason for hiding this comment

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

We can't post thin air! doesn't work. There's no way to fit in "air" into this sentence without it sounding weird/forced. It needs to be a completely different sentence.

Here's an AI generated option that sounds much better: "Even magicians can't post nothing!"

Copy link
Contributor

Choose a reason for hiding this comment

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

you applied my suggestion incorrectly. Same comment for line below

Suggested change
raise UserError(_("Oops! You can't change the period/account for posted entries! Only the draft ones are up for such an adventure like that!"))
raise UserError(_("Oops! You can't change the period/account for posted entries! Only the draft ones are up for an adventure like that!"))

Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect grammar:

Suggested change
raise UserError(_("You can't change the company of an analytic account having analytic items around! It's a recipe for an analytical disaster!"))
raise UserError(_("You can't change the company of an analytic account that has analytic items lying around! It's a recipe for an analytical disaster!"))

That being said, not sure if "lying around" is what the original change was going for. If not, then the more straightforward:

Suggested change
raise UserError(_("You can't change the company of an analytic account having analytic items around! It's a recipe for an analytical disaster!"))
raise UserError(_("You can't change the company of an analytic account that already has analytic items! It's a recipe for an analytical disaster!"))

is better

Copy link
Contributor

Choose a reason for hiding this comment

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

This is correct, but will be terrible in certain countries/cultures where smiling isn't as common as it is in the US/Belgium.

Copy link
Contributor

Choose a reason for hiding this comment

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

This "Update All" button wording is a bit confusing. You're not updating all the records, only the ones you have selected. So maybe this is better?

Suggested change
Update All
Update

Comment on lines 68 to 72
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<p t-if="props.resIds.length > 1">Ready to make those web pages disappear into thin air? Are you sure?\n It will be gone forever!\n
<span class="text-warning">But before deleting them, make sure you update all links referring to them. That way, your customers won't bump into the not-so-famous 404 error page.</span>
</p>
<p t-else="">Ready to make this web page disappear into thin air? Are you sure?\n It will be gone forever!\n
<span class="text-warning">But before deleting it, make sure you update all links referring to it. That way, your customers won't bump into the not-so-famous 404 error page.</span>
<p t-if="props.resIds.length > 1">Ready to make these web pages disappear into thin air? Are you sure?\n They will be gone forever!\n
<span class="text-warning">But before deleting, make sure you update all links referring to them. That way, your customers won't bump into the not-so-famous 404 error page.</span>
</p>
<p t-else="">Ready to make this web page disappear into thin air? Are you sure?\n It will be gone forever!\n
<span class="text-warning">But before deleting, make sure you update all links referring to it. That way, your customers won't bump into the not-so-famous 404 error page.</span>

Comment on lines 44 to 45
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'Uh-oh! You can’t delete a survey used as a Course Certification! Otherwise, students might think diplomas just grow on trees.\n'
'The courses that need it are:\n%s',
'Uh-oh! You can’t delete surveys used as a Course Certification! Otherwise, students might think diplomas just grow on trees.\n'
'The courses that need them are:\n%s',

Comment on lines 2965 to 3019
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Our troublemaker is: %(model_display)s\n"
"Blame the following constraint: %(field_display)s\n"
"How about archiving the record instead?",
"The troublemaker is: %(model_display)s\n"
"Thanks to the following constraint: %(field_display)s\n"
"How about archiving the record instead?",

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
lines.append(_("To avoid a mess, no company crossover allowed!"))
lines.append(_("To avoid a mess, no company crossover is allowed!"))

@william-andre
Copy link
Contributor

Please make sure you correctly apply all of my grammar change suggestions. I don't have time to review all of the strings again.

Shouldn't this kind of tasks be done by native (probably from the US) speakers...?

Copy link
Contributor

@dylankiss dylankiss left a comment

Choose a reason for hiding this comment

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

Some suggestions, but also some important functional issues. Please check them carefully 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you directly raising a UserError here and below instead of appending it to the list of errors to show in the end? Because all the rest is left the same 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise UserError(_("Oops! You can't change the period/account for posted entries! Only the draft ones are up for such an adventure like that!"))
raise UserError(_("Oops! You can only change the period or account for posted entries! Other ones aren't up for an adventure like that!"))

Oops, seems like you totally changed the meaning of this message. The original message says that you can only change the period or account for posted journal items, not for other ones! Please correct this.

Comment on lines 2423 to 2424
Copy link
Contributor

Choose a reason for hiding this comment

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

@ticodoo Maybe another suggestion?

Suggested change
"The journal entry is not balanced,"
"with %(debit_total)s on the debit side and %(credit_total)s on the credit side. We need some equilibrium here!\n\n"
"The journal entry is not balanced. "
"With %(debit_total)s on the debit side and %(credit_total)s on the credit side, we've disrupted the equilibrium!\n\n"

Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above. Why raising here already?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise ValidationError(_("Once a document is posted, its type is set in stone and you can't change it anymore."))
raise ValidationError(_("Once a document has been posted once, its type is set in stone and you can't change it anymore."))

You lost some nuance in the message. The type can't be changed anymore if the entry has ever been posted before. So even if they reset it to draft afterwards, it would still remain immutable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise UserError(error_message % state_description_values.get(self[:1].state))
raise UserError("You can't delete a time off request that is in %(leave_state)s state.", leave_state=state_description_values.get(self[:1].state))

Copy link
Contributor

Choose a reason for hiding this comment

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

@ticodoo Maybe even this?

Suggested change
raise UserError(_("You can't delete a time off which is in the past"))
raise UserError(_("You can't delete a time off request that is in the past."))

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
raise UserError(error_message % (state_description_values.get(holiday.state),))
raise UserError("You can't delete a time off request that is in %(leave_state)s state.", leave_state=state_description_values.get(holiday.state))

Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to validate if this is only for food, and not for drinks too. Maybe this is better? @ticodoo

Suggested change
raise ValidationError(_('Oh no! You don’t have enough money in your wallet to order that food! Contact your lunch manager to add some money in your wallet.'))
raise ValidationError(_('Oh no! You don’t have enough money in your wallet to order your selected lunch! Contact your lunch manager to add some money to your wallet.'))

Copy link
Contributor

Choose a reason for hiding this comment

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

It is also for drinks. If we want to keep it generic, we can make it your selected items, in case someone is using the lunch app...for other non-lunch meals/things.

Copy link
Contributor

Choose a reason for hiding this comment

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

Uhh, this line looks extremely awkward in context

Totally agree. I don't really understand the purpose in this context 🤔

@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch from 9576c89 to d3e3ead Compare March 7, 2025 11:25
@fpodoo
Copy link
Contributor

fpodoo commented Mar 10, 2025

@robodoo r+

1 similar comment
@fpodoo
Copy link
Contributor

fpodoo commented Mar 10, 2025

@robodoo r+

@robodoo
Copy link
Contributor

robodoo commented Mar 10, 2025

This PR is already reviewed, reviewing it again is useless.

@robodoo
Copy link
Contributor

robodoo commented Mar 10, 2025

@ppr-odoo @fpodoo linked pull request(s) odoo/enterprise#69284 not ready. Linked PRs are not staged until all of them are ready.

@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch 2 times, most recently from 87cb46f to 8a24aec Compare March 17, 2025 08:02
@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch 3 times, most recently from e3119e1 to c40d7f7 Compare April 24, 2025 05:30
@xavierbol
Copy link
Contributor

Hello @ppr-odoo

Can you rebase your branch?

We will surely merge that this week.

Comment on lines +38 to +52
Copy link
Contributor

Choose a reason for hiding this comment

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

Cannot we directly write those messages in the template as before? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

You can check the result in the pot file.

Having it in template with a t-esc in the middle makes separate translation phrases for each part such as "are valid for this update." (alone by itself) which makes no sense for translators.

Not only is it hard to understand, but different languages need the counter to be at different places in the phrase.

It's important to never concatenate parts of translations together in code (or in template) as those usually only work in English.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah okay. 🙂

Thanks for the explanation! 🙂

Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.

In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.

task-3422664

Co-authored-by: Kartik Chavda <kcv@odoo.com>
Co-authored-by: Kamlesh Pathekar (kpt) <kpt@odoo.com>
Co-authored-by: Aman Patel (ampa) <ampa@odoo.com>
@ppr-odoo ppr-odoo force-pushed the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch from c40d7f7 to fbede01 Compare May 8, 2025 13:40
Copy link
Contributor

@xavierbol xavierbol left a comment

Choose a reason for hiding this comment

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

robodoo r+

robodoo pushed a commit that referenced this pull request May 11, 2025
Before this commit error messages in odoo are boring and
not much attractive to user. Those were like odoo is preventing
them from doing something user want to do.

In this commit, we have modified the message to be a more friendly
and humorous tone, making it less tedious and more enjoyable. It
aims to enhance the user experience and ensure that interactions
with any application are both pleasant and informative. As a result,
the messages have been clear, short, easy to understand and informative.

task-3422664

closes #178821

Related: odoo/enterprise#69284
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Kartik Chavda <kcv@odoo.com>
Co-authored-by: Kamlesh Pathekar (kpt) <kpt@odoo.com>
Co-authored-by: Aman Patel (ampa) <ampa@odoo.com>
@robodoo robodoo added the 18.4 label May 11, 2025
@robodoo robodoo closed this May 11, 2025
@fw-bot fw-bot deleted the master-user-error-fine-tuning-ux-kcv-kpt-ppr branch May 18, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

18.4 RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.