Issue 9248

Title
Product with newline in name is lost
Priority
bug
Status
resolved
Nosy list
ced, pokoli, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2020-04-21.17:51:53 by pokoli, last changed 2 months ago by roundup-bot.

Messages

New changeset 6029af109ee5 by Cédric Krier in branch 'default':
Use proper format character in forbidden char message
https://hg.tryton.org/tryton-env/rev/6029af109ee5
New changeset c3e38f487a9b by Cédric Krier in branch 'default':
Use proper format character in forbidden char message
https://hg.tryton.org/trytond/rev/c3e38f487a9b
New changeset eca0e2d8a8bd by Cédric Krier in branch 'default':
Forbid all white spaces except space in Char field
https://hg.tryton.org/tryton-env/rev/eca0e2d8a8bd
New changeset a2f811ed0e99 by Cédric Krier in branch 'default':
Forbid all white spaces except space in Char field
https://hg.tryton.org/trytond/rev/a2f811ed0e99
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-10-24.17:22:04

I tried to use textarea with rows=1 instead of input text but this does not render nor behave as good as input.
And comparing by stripping CRLF does not seem to be very reliable.
So I think it is better to prevent to store these kind of white spaces in Char fields because they are even not correctly displayed in all OS under GTK (see issue7914).

Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-04-30.13:29:28
Input text can reach more than one line, so the only option is to compare removing the CRLF
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-04-21.18:12:52
It looks like the <input type="text"/> strip <CR> (and mayb other like <CRLF> or <EOF>).
So we can either find a way to keep the <CR> or to compare values by removing also the <CR>. The first option should be the best option.
Author: [hidden] (pokoli) Tryton committer Tryton translator
Date: 2020-04-21.17:51:52
We've found some strange bug on sao today that make the product of an invoice disapear after after creating a line with it. 

Here are the steps to reproduce:

1. Create a product with a new line on it. This can be done using tryton but only copypasting some text with newline on it. You will see that on Tryton an arrow is shown to represent the newline.
2. Go to sao and create a new invoice line using this product.
3. After saving the invoice the product disapears from the form.

(same procedure works as expected on tryton)

This is because the name of the product is compared with the input value [1] but the newline value is not present on the html widget, so the field is removed. 

We've found it with products that are not created from the user interface but importing an external file (which contained the new line characters). I consider this a corner case out of the normal usage but I'm also reporting this bug to see if we can do something to prevent that the many2one field is cleared.



[1] https://hg.tryton.org/sao/file/0e779982f8ba/src/view/form.js#l2417
History
Date User Action Args
2020-11-06 00:51:34roundup-botsetmessages: + msg61698
2020-11-06 00:51:32roundup-botsetmessages: + msg61697
2020-11-05 23:58:43roundup-botsetmessages: + msg61692
2020-11-05 23:58:39roundup-botsetmessages: + msg61691
nosy: + roundup-bot
status: testing -> resolved
2020-10-26 11:50:22reviewbotsetmessages: + msg61412
2020-10-24 17:29:15reviewbotsetmessages: + msg61365
nosy: + reviewbot
2020-10-24 17:26:23cedlinkissue7914 superseder
2020-10-24 17:24:54cedsetkeyword: + review
reviews: 312681002
status: in-progress -> testing
2020-10-24 17:22:04cedsetassignedto: ced
component: + trytond, - sao
messages: + msg61363
status: chatting -> in-progress
2020-06-03 21:35:23pokolisetassignedto: pokoli -> (no value)

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