Merge lp:~julie-w/unifield-server/US-5363 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5245
Proposed branch: lp:~julie-w/unifield-server/US-5363
Merge into: lp:unifield-server
Diff against target: 108 lines (+0/-60)
2 files modified
bin/addons/account/report/free_allocation_report.mako (+0/-29)
bin/addons/account/report/free_allocation_report.py (+0/-31)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5363
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+362774@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 'bin/addons/account/report/free_allocation_report.mako'
2--- bin/addons/account/report/free_allocation_report.mako 2018-08-17 09:43:51 +0000
3+++ bin/addons/account/report/free_allocation_report.mako 2019-02-06 10:02:17 +0000
4@@ -266,35 +266,6 @@
5 </Cell>
6 </Row>
7 % endfor
8- <!-- TOTAL -->
9- <% total_l = total_line(entry_seq) %>
10- % if total_l:
11- <Row>
12- <% total_str = "%s %s" % (_("Total"), entry_seq) %>
13- <Cell ss:StyleID="ssBorderBold">
14- <Data ss:Type="String">${total_str|x}</Data>
15- </Cell>
16- <Cell ss:StyleID="ssBorderBold" ss:MergeAcross="5"></Cell>
17- <Cell ss:StyleID="ssNumberBold">
18- <Data ss:Type="Number">${total_l['book_amount']}</Data>
19- </Cell>
20- <Cell ss:StyleID="ssBorderBold">
21- <Data ss:Type="String">${total_l['book_currency']|x}</Data>
22- </Cell>
23- <Cell ss:StyleID="ssNumberBold">
24- <Data ss:Type="Number">${total_l['func_amount']}</Data>
25- </Cell>
26- <Cell ss:StyleID="ssBorderBold">
27- <Data ss:Type="String">${company.currency_id.name|x}</Data>
28- </Cell>
29- </Row>
30- % endif
31- % if lines(data)[entry_seq]:
32- <!-- EMPTY LINE BETWEEN EACH ENTRY SEQ. -->
33- <Row>
34- <Cell ss:MergeAcross="10"><Data ss:Type="String"></Data></Cell>
35- </Row>
36- % endif
37 % endfor
38
39 </Table>
40
41=== modified file 'bin/addons/account/report/free_allocation_report.py'
42--- bin/addons/account/report/free_allocation_report.py 2018-08-22 12:40:42 +0000
43+++ bin/addons/account/report/free_allocation_report.py 2019-02-06 10:02:17 +0000
44@@ -29,10 +29,8 @@
45 def __init__(self, cr, uid, name, context=None):
46 super(free_allocation_report, self).__init__(cr, uid, name, context=context)
47 self.lines = {}
48- self.total_lines = {}
49 self.localcontext.update({
50 'lines': self._get_lines,
51- 'total_line': self._get_total_line,
52 'get_proprietary_instance': self._get_proprietary_instance,
53 'get_accounts': self._get_accounts,
54 'get_journals': self._get_journals,
55@@ -49,7 +47,6 @@
56 """
57 Returns the report lines as a dict where key = Entry Sequence,
58 and value = list of dicts, each corresponding to a line to display
59- + fills in the self.total_lines for each Entry Sequence
60
61 Formula for one combination with all axis:
62 total_JI x (amount_DEST_CC_FP_A/total_JI) x (amount_free1A/total_JI) x (amount_free2A/total_JI)
63@@ -97,9 +94,6 @@
64 for move in move_obj.browse(self.cr, self.uid, move_ids, fields_to_fetch=['name'], context=context):
65 current_line_position += 1
66 self.lines[move.name] = []
67- book_total = 0.0
68- func_total = 0.0
69- book_currency = ''
70 aml_dom = [('move_id', '=', move.id)]
71 if account_ids:
72 aml_dom.append(('account_id', 'in', account_ids))
73@@ -235,35 +229,10 @@
74 'func_currency': aml.functional_currency_id and aml.functional_currency_id.name or '',
75 }
76 self.lines[move.name].append(line)
77- book_total += book_amount or 0.0
78- func_total += func_amount or 0.0
79- # create the total line for each Entry Sequence
80- if self.lines[move.name]:
81- self.total_lines[move.name] = {
82- 'book_amount': book_total,
83- 'book_currency': book_currency,
84- 'func_amount': func_total,
85- }
86- else:
87- # empty total line in case there is no analytic line for this move
88- self.total_lines[move.name] = {}
89 # update percentage of the report loading
90 bg_obj.compute_percent(self.cr, self.uid, current_line_position, len(move_ids), context=context)
91 return self.lines
92
93- def _get_total_line(self, entry_sequence):
94- """
95- Returns a dict with functional amount, and booking amount & currency for the Entry Seq. in parameter
96- """
97- if entry_sequence in self.total_lines:
98- return self.total_lines[entry_sequence]
99- else:
100- return {
101- 'book_amount': 0.0,
102- 'book_currency': '',
103- 'func_amount': 0.0,
104- }
105-
106 def _get_proprietary_instance(self, data):
107 """
108 Returns the code of the Prop. Instance selected in the wizard if any

Subscribers

People subscribed via source and target branches