Issue 10500

Title
InvoiceLineValidationError error message is not displayed correctly.
Priority
bug
Status
resolved
Nosy list
ced, juanjogp, pokoli, reviewbot, roundup-bot
Assigned to
juanjogp
Keywords
review

Created on 2021-06-11.10:33:47 by juanjogp, last changed 1 week ago by roundup-bot.

Messages

New changeset 39440f853093 by Juanjo Garcia in branch '6.0':
Use proper variable name when formatting same account error message
https://hg.tryton.org/modules/account_invoice/rev/39440f853093

New changeset a1bb61f06eec by Juanjo Garcia in branch '5.8':
Use proper variable name when formatting same account error message
https://hg.tryton.org/modules/account_invoice/rev/a1bb61f06eec
New changeset 0cf92caed305 by C├ędric Krier in branch 'default':
Use proper variable name when formatting same account error message
https://hg.tryton.org/tryton-env/rev/0cf92caed305
New changeset e37577def17b by Juanjo Garcia in branch 'default':
Use proper variable name when formatting same account error message
https://hg.tryton.org/modules/account_invoice/rev/e37577def17b

New changeset 7e61dbcfcfab by Juanjo Garcia in branch 'default':
Use the proper variable name in the same account error message
https://hg.tryton.org/modules/account_invoice/rev/7e61dbcfcfab
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2021-06-11.11:24:42

Indeed we need to do both: change the variable for backport and update the message for trunk.

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2021-06-11.10:42:38

I think it will be better to just update the variable definition on the code, so the change can be easy backported.

For new versions we can just update the message and the string will be translated to the new release.

P.S: Please assign the issue to yourself if you are going to work on it and set the proper state.

Author: [hidden] (juanjogp)
Date: 2021-06-11.10:33:46

The message for the error InvoiceLineValidationError does not work correctly.
As we can see the function check_same_account raise the validation error "InvoiceLineValidationError" shows the message "msg_invoice_same_account_line", this message use the variables: account, invoice and line:

raise InvoiceLineValidationError(
    gettext('account_invoice.msg_invoice_same_account_line',
        account=self.account.rec_name,
        invoice=self.invoice.rec_name,
        line=self.rec_name))

But if we look at the message file we can see that the message uses the variables: account, invoice and lines:

    <field name="text">You cannot use the same account "%(account)s" on invoice "%(invoice)s" and on line "%(lines)s"</field>
    </record>

This means we have to change in the message the variable lines to line. And make this change in all the languages.

History
Date User Action Args
2021-07-21 12:09:14roundup-botsetmessages: + msg68966
2021-07-07 14:35:51roundup-botsetmessages: + msg68755
2021-07-07 14:35:36roundup-botsetmessages: + msg68754
nosy: + roundup-bot
status: testing -> resolved
2021-06-18 09:22:48pokolisetstatus: chatting -> testing
2021-06-15 10:35:50reviewbotsetmessages: + msg68259
2021-06-14 10:55:52reviewbotsetmessages: + msg68234
2021-06-14 10:47:43juanjogpsetreviews: 371071002 -> 371071002, 348701002
2021-06-14 09:21:24juanjogpsetassignedto: juanjogp
2021-06-11 11:24:42cedsetmessages: + msg68218
nosy: + ced
2021-06-11 11:07:35reviewbotsetmessages: + msg68217
nosy: + reviewbot

Showing 10 items. Show all history (warning: this could be VERY long)