← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 872251] Re: [V6] remove carriage return on field of text type

 

On 11/04/2011 10:35 AM, Naresh(OpenERP) wrote:
> I would also like to throw some light on this . first of all the fix for
> bug:559788 was on char field and not on text field.
> (in/widget/view/form_gtk/char.py).  which strips the data of the char
> field when a user inputs data through the client.

Ah, good point, thanks! It seems sensible to strip whitespace at the end
of user input in char fields, but probably we should be careful that
this behavior is not inherited by other field types, e.g. text, where
this is not desired.

> Secondly: The problem for the bug is in field.py where the stripping is
> done before setting the value internally in the model of client.(this
> was actually a fix when demo data contains extra spaces,newline char etc
> indeed this will affect all the field type which has been inherited from
> char class(like the text field type).

Thanks for the additional analysis!

> Conclusion and Questions:
> * What I prefer based on this three bugs(2
> lp + demo data) that we should remove the strip function from
> fields.py and if the demo data contains any extra spaces that should
> be simply considered as  a user error rather then a bug. * I dont opt
> to revert the fix for 559788. (as its a fix for user enter values
> directly from client only for char field type)
> 
> I would like to revert the same from trunk too?

This approach sounds fine to me, based on your analysis above.

Basically, we should never strip whitespace from data coming from the
database, nor when typing data in textareas (fields.text).
The only case where stripping whitespace is desired is when manually
typing or copy/pasting a value in a simple textfield (probably just for
char, and perhaps integer/float fields), to avoid undesired duplicate
values.

Thanks!

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/872251

Title:
  [V6] remove carriage return on field of text type

Status in OpenERP GTK Client:
  Confirmed
Status in OpenERP GTK Client 6.0 series:
  Fix Committed
Status in OpenERP GTK Client trunk series:
  Confirmed

Bug description:
  Hello,

  When you want to a carriage return in a field of text type, the carriage return was automatically removed from the text field when you saved it.
  For my customer it's really annoying because my customer use it to make invoice layout on RML report. 
  The GTK Client mustn't do automatic modification on text field.

  Thanks for your help,

  Vincent

  
  Thanks for your help,

  Vincent

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-client/+bug/872251/+subscriptions


References