thousand separator doesn't work on reports

Bug #1294088 reported by Yug Faa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned
Odoo Server (MOVED TO GITHUB)
New
Undecided
Unassigned

Bug Description

Hi every body

from launguage form, in the separator input, make [3,3,-1]

On the system all amount are shown well 10000 => 10 000 with whitespace separator

On report, all of this doesn't work, and the reason is the bloc :

            while seps:
                sp = formatted.find(' ')
                if sp == -1: break
                formatted = formatted[:sp] + formatted[sp+1:]
                seps -= 1

this bloc, has no meaning, we separate the amount and this bloc come to remove separator, and the problem is that the varaible seps is given with the separator, this bloc has to be removed

File : res_lang Function : def format(.... Line : 214

Yug Faa (vim6574)
Changed in openobject-addons:
status: New → In Progress
status: In Progress → New
summary: - thousand separator doesn't word on reports
+ thousand separator doesn't work on reports
Revision history for this message
Cedric Le Brouster(OpenFire) (cedric-lebrouster) wrote :

Hi Yug,

You should change your your separator for a non-breaking space (unicode 00A0).
It prevents number breaking in views and some reports, and protects you from this bug.

Revision history for this message
Yug Faa (vim6574) wrote :

Hi Cedric

Can you please explain more or give us an example, if we use u"\u0020" as separator, we need to add eval() in source code, so it's a bug,

Thanks

Yug Faa (vim6574)
Changed in openobject-addons:
assignee: nobody → Yug Faa (vim6574)
assignee: Yug Faa (vim6574) → nobody
Revision history for this message
Cedric Le Brouster(OpenFire) (cedric-lebrouster) wrote :

I nerver said it's not a bug.
I only gave a way for you to make things work.
I had the same problem and I solved it this way :
- I open a python terminal (command in shell : python)
- I use command : print u'a\u00A0a'
(I use the 'a' chars as delimiters to "see" the space
- I copy/paste this text non-breaking space in the thousands separator field of my language, in openerp form.
Don't forget to remove the 'a' and the old previous whitespace.

There must be easier ways to do it, for example in SQL, but this is a quite easy one.

Of course you could also make or modify a module to make it for you.
For information, this thousands separator is read from your operating system language parameters. So the fact it's a whitespace instead of a non-breaking space is not a bug from openerp.

Nevertheless, I agree whitespaces should not be deleted on reports.

Revision history for this message
Yug Faa (vim6574) wrote :

Thank you so much, Cederic, that's work well

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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