Bug on new lines in char class when you paste from the clipboard

Bug #559788 reported by Moisés López - http://www.vauxoo.com
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Odoo GTK Client (MOVED TO GITHUB)
Fix Released
Low
OpenERP sa GTK client R&D

Bug Description

When you paste text with new lines in char widget
The new line not is visible in the form view, even in tree-list view and the database.

These is confuse.

Related branches

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :
Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

If I copy a string in a text editor that has new lines and stick it in Openerp-client-gtk/field char, this new line is preserved.

Revision history for this message
Nhomar - Vauxoo (nhomar) wrote :

Hello,

Can you please tell what is the "revno" of reference where you put this diff???? to try use it! this bug is affecting to me too!

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Sometimes we do not express myself correctly, because they use a translator es_en
ut I create a video for a better understanding.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

Hola mi buen amigo Nhomar

I generate the patch in my local repository with TORTOISE-SVN
But in the file tell you, what file, lines and function affect.

The bazaar version of openerp-client-gtk is: http://bazaar.launchpad.net/~openerp/openobject-client/5.0/ - rv1068.

Index: bin/widget/view/form_gtk/char.py
===================================================================
--- ../openerp-client-gtk/bin/widget/view/form_gtk/char.py (working copy)
+++ ../openerp-client-gtk/bin/widget/view/form_gtk/char.py (working copy)
@@ -42,14 +42,18 @@
         self.widget.connect('focus-out-event', lambda x,y: self._focus_out())

     def set_value(self, model, model_field):
- return model_field.set_client(model, self.widget.get_text() or False)
+ text = self.widget.get_text()
+ text = text and text.replace('\n', '').replace('\r', '') or ''
+ return model_field.set_client(model, text)

     def display(self, model, model_field):
         if not model_field:
             self.widget.set_text('')
             return False
         super(char, self).display(model, model_field)
- self.widget.set_text(model_field.get(model) or '')
+ text = model_field.get(model)
+ text = text and text.replace('\n', '').replace('\r', '') or ''
+ self.widget.set_text( text )

     def _readonly_set(self, value):
         self.widget.set_editable(not value)
:

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

I upload the revno patch.

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) wrote :

revno - 1070
~openerp/openobject-client/5.0/

Changed in openobject-client:
assignee: nobody → Jay (Open ERP) (jvo-openerp)
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,
Can you try out with this patch attached

Changed in openobject-client:
assignee: Jay (Open ERP) (jvo-openerp) → nch(OpenERP) (nch-openerp)
milestone: none → 6.0
status: New → Confirmed
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

It has been improved at lp:~openerp-dev/openobject-client/trunk-dev-client with revision-info as 1404 <email address hidden> and will be merged soon to the trunk client.

Thanks,

Changed in openobject-client:
status: Confirmed → In Progress
assignee: nch(OpenERP) (nch-openerp) → OpenERP sa GTK client R&D (openerp-dev-gtk)
milestone: 6.0 → 6.0-rc2
importance: Undecided → Low
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.