odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] web: missing currency symbol on kanban column

Open daiduongnguyen-odoo opened this issue 1 year ago • 12 comments

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

daiduongnguyen-odoo avatar Aug 09 '24 06:08 daiduongnguyen-odoo

Pull request status dashboard

robodoo avatar Aug 09 '24 06:08 robodoo

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

daiduongnguyen-odoo avatar Aug 09 '24 06:08 daiduongnguyen-odoo

@kebeclibre Can you take a look when you have time, please ?

daiduongnguyen-odoo avatar Aug 13 '24 07:08 daiduongnguyen-odoo

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: image

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.

aab-odoo avatar Aug 13 '24 13:08 aab-odoo

Task 4114269

aab-odoo avatar Aug 13 '24 14:08 aab-odoo

@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?

daiduongnguyen-odoo avatar Aug 14 '24 04:08 daiduongnguyen-odoo

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.

aab-odoo avatar Aug 14 '24 06:08 aab-odoo

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

daiduongnguyen-odoo avatar Aug 15 '24 13:08 daiduongnguyen-odoo

Hello @aab-odoo How are you doing ? Did your team finish discussion about this ? Thanks

daiduongnguyen-odoo avatar Aug 26 '24 07:08 daiduongnguyen-odoo

Hello @aab-odoo any update on this ? thank you in advance

daiduongnguyen-odoo avatar Sep 10 '24 10:09 daiduongnguyen-odoo

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 avatar Sep 19 '24 08:09 kebeclibre

@kebeclibre ok, feel free to modify or request change as i just copy and do same in list view hihi

daiduongnguyen-odoo avatar Sep 19 '24 08:09 daiduongnguyen-odoo

Hello @kebeclibre @aab-odoo I have done what you said and create a test in crm, can you check if you have time please ?

daiduongnguyen-odoo avatar Dec 27 '24 09:12 daiduongnguyen-odoo