Merge lp:~jfb-tempo-consulting/unifield-web/US-5548 into lp:unifield-web/uf12

Proposed by jftempo
Status: Merged
Merged at revision: 4956
Proposed branch: lp:~jfb-tempo-consulting/unifield-web/US-5548
Merge into: lp:unifield-web/uf12
Diff against target: 32 lines (+8/-3)
2 files modified
addons/openerp/widgets/listgroup.py (+7/-2)
addons/openerp/widgets/templates/listgrid/listgroup.mako (+1/-1)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-web/US-5548
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+365229@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/widgets/listgroup.py'
2--- addons/openerp/widgets/listgroup.py 2018-10-24 13:19:18 +0000
3+++ addons/openerp/widgets/listgroup.py 2019-03-28 11:12:24 +0000
4@@ -116,8 +116,13 @@
5 for key, val in rec.items():
6 if isinstance(val, float):
7 rounding_digit = digit
8- if rounding_values and fields.get(key, {}).get('related_uom') and rec.get(fields.get(key, {}).get('related_uom')) in rounding_values:
9- rounding_digit = int(abs(math.log10(rounding_values[rec[fields[key]['related_uom']]])))
10+ if rounding_values and fields.get(key, {}).get('related_uom'):
11+ if isinstance(rec.get(fields.get(key, {}).get('related_uom')), tuple) and rec.get(fields.get(key, {}).get('related_uom')):
12+ uom_id = rec.get(fields.get(key, {}).get('related_uom'))[0]
13+ else:
14+ uom_id = rec.get(fields.get(key, {}).get('related_uom'))
15+ if uom_id in rounding_values:
16+ rounding_digit = int(abs(math.log10(rounding_values[uom_id])))
17 rec[key] = format.format_decimal(val or 0.0, rounding_digit, computation=computation)
18
19 for grp_by in group_by:
20
21=== modified file 'addons/openerp/widgets/templates/listgrid/listgroup.mako'
22--- addons/openerp/widgets/templates/listgrid/listgroup.mako 2018-11-09 13:55:45 +0000
23+++ addons/openerp/widgets/templates/listgrid/listgroup.mako 2019-03-28 11:12:24 +0000
24@@ -82,7 +82,7 @@
25 % else:
26 % if grp_row.get(field):
27 % if field_attrs.get('type') == 'many2one':
28- ${grp_row.get(field)[-1]}
29+ ${isinstance(grp_row.get(field), (int, long)) and " " or grp_row.get(field)[-1]}
30 % elif field_attrs.get('type') == 'selection':
31 ${[fld_select[1] for fld_select in field_attrs['selection'] if fld_select[0] == grp_row[field]][0]}
32 % else:

Subscribers

People subscribed via source and target branches

to all changes: