[FIX] web: missing currency symbol on kanban column
Close https://github.com/odoo/odoo/issues/174408
- STEP TO REPRODUCE: go to crm -> kanban mode -> see each column and find no currency symbol, only amount display unlike in v15
- PROBLEM: The issue is deeper than the missing currency symbol. For now, we display the aggregate value but we don't know if all records share the same currency or not. If not, the displayed value makes no sense. The problem is different from the list case, because here, the sum is computed server side (by the read_group), on all records of the column (ignoring the limit). In the list case, this is the sum of the displayed records. We compute it client side, and we know the currency of each of those records, so it's easier.
- SOLUTION: Do same like in list view display 0 value (why 0 because the props require numeric value) and a title 'Different currencies cannot be aggregated'
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Hello @Julien00859 @aab-odoo Can you take a look please ? There is a problem that what if the currency use in kanban is different to company_currency, should we do something like in tree view https://github.com/odoo/odoo/blob/16.0/addons/web/static/src/views/list/list_renderer.js#L556
@kebeclibre Can you take a look when you have time, please ?
Hello @duong77476-viindoo
Indeed, the issue is deeper than the missing currency symbol. For now, we display the aggregate value but we don't know if all records share the same currency or not. If not, the displayed value makes no sense. The problem is different from the list case that you spotted, because here, the sum is computed server side (by the read_group), on all records of the column (ignoring the limit). In the list case, this is the sum of the displayed records. We compute it client side, and we know the currency of each of those records, so it's easier.
For the record, in v15, the currency symbol was displayed, but it was the currency symbol of the first record of the column, which can lead to that kind of weirdness/inconsistency:
I think the correct solution is to have a similar behavior as in the list (which is less easy to implement, as I said), that is, only display the sum (with its currency) when it makes sense. I'll create an internal task and keep you in touch.
Task 4114269
@aab-odoo So if i understand correctly, if we have 2 record in kanban view with different currency like 100 $ and 50 €. The sum which will be display in each kanban column should be something like 100$, 50€ not 150$ or 150€ right?
Definitely not 150$ or 150€, as this is completely incorrect and misleading. In the list view, we display - in that kind of situation (i.e. we don't display the total, because it doesn't make sense). I think we should do the same, but this will be discussed internally.
Definitely not 150$ or 150€, as this is completely incorrect and misleading. In the list view, we display
-in that kind of situation (i.e. we don't display the total, because it doesn't make sense). I think we should do the same, but this will be discussed internally.
I manage to do as you said, but i can't display - because it only allow me to display number.
Here is the demo video, feel free to check it out , thanks
https://github.com/user-attachments/assets/60f02be9-77cd-4a2c-98ec-45e05817afb2
Hello @aab-odoo How are you doing ? Did your team finish discussion about this ? Thanks
Hello @aab-odoo any update on this ? thank you in advance
Hello, the discussion was inconclusive at the moment as we are at the end of our development cycle. one of the leads is to make the groupby in python aware that the field on which we group will have several values, and hence implies a groupby on currency
I made a comment, I think we just need to loop over records for a given field
It will need a test to be mergeable anyway
@kebeclibre ok, feel free to modify or request change as i just copy and do same in list view hihi
Hello @kebeclibre @aab-odoo I have done what you said and create a test in crm, can you check if you have time please ?
