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
=== modified file 'bin/addons/account/report/free_allocation_report.mako'
--- bin/addons/account/report/free_allocation_report.mako 2018-08-17 09:43:51 +0000
+++ bin/addons/account/report/free_allocation_report.mako 2019-02-06 10:02:17 +0000
@@ -266,35 +266,6 @@
266 </Cell>266 </Cell>
267 </Row>267 </Row>
268 % endfor268 % endfor
269 <!-- TOTAL -->
270 <% total_l = total_line(entry_seq) %>
271 % if total_l:
272 <Row>
273 <% total_str = "%s %s" % (_("Total"), entry_seq) %>
274 <Cell ss:StyleID="ssBorderBold">
275 <Data ss:Type="String">${total_str|x}</Data>
276 </Cell>
277 <Cell ss:StyleID="ssBorderBold" ss:MergeAcross="5"></Cell>
278 <Cell ss:StyleID="ssNumberBold">
279 <Data ss:Type="Number">${total_l['book_amount']}</Data>
280 </Cell>
281 <Cell ss:StyleID="ssBorderBold">
282 <Data ss:Type="String">${total_l['book_currency']|x}</Data>
283 </Cell>
284 <Cell ss:StyleID="ssNumberBold">
285 <Data ss:Type="Number">${total_l['func_amount']}</Data>
286 </Cell>
287 <Cell ss:StyleID="ssBorderBold">
288 <Data ss:Type="String">${company.currency_id.name|x}</Data>
289 </Cell>
290 </Row>
291 % endif
292 % if lines(data)[entry_seq]:
293 <!-- EMPTY LINE BETWEEN EACH ENTRY SEQ. -->
294 <Row>
295 <Cell ss:MergeAcross="10"><Data ss:Type="String"></Data></Cell>
296 </Row>
297 % endif
298% endfor269% endfor
299270
300</Table>271</Table>
301272
=== modified file 'bin/addons/account/report/free_allocation_report.py'
--- bin/addons/account/report/free_allocation_report.py 2018-08-22 12:40:42 +0000
+++ bin/addons/account/report/free_allocation_report.py 2019-02-06 10:02:17 +0000
@@ -29,10 +29,8 @@
29 def __init__(self, cr, uid, name, context=None):29 def __init__(self, cr, uid, name, context=None):
30 super(free_allocation_report, self).__init__(cr, uid, name, context=context)30 super(free_allocation_report, self).__init__(cr, uid, name, context=context)
31 self.lines = {}31 self.lines = {}
32 self.total_lines = {}
33 self.localcontext.update({32 self.localcontext.update({
34 'lines': self._get_lines,33 'lines': self._get_lines,
35 'total_line': self._get_total_line,
36 'get_proprietary_instance': self._get_proprietary_instance,34 'get_proprietary_instance': self._get_proprietary_instance,
37 'get_accounts': self._get_accounts,35 'get_accounts': self._get_accounts,
38 'get_journals': self._get_journals,36 'get_journals': self._get_journals,
@@ -49,7 +47,6 @@
49 """47 """
50 Returns the report lines as a dict where key = Entry Sequence,48 Returns the report lines as a dict where key = Entry Sequence,
51 and value = list of dicts, each corresponding to a line to display49 and value = list of dicts, each corresponding to a line to display
52 + fills in the self.total_lines for each Entry Sequence
5350
54 Formula for one combination with all axis:51 Formula for one combination with all axis:
55 total_JI x (amount_DEST_CC_FP_A/total_JI) x (amount_free1A/total_JI) x (amount_free2A/total_JI)52 total_JI x (amount_DEST_CC_FP_A/total_JI) x (amount_free1A/total_JI) x (amount_free2A/total_JI)
@@ -97,9 +94,6 @@
97 for move in move_obj.browse(self.cr, self.uid, move_ids, fields_to_fetch=['name'], context=context):94 for move in move_obj.browse(self.cr, self.uid, move_ids, fields_to_fetch=['name'], context=context):
98 current_line_position += 195 current_line_position += 1
99 self.lines[move.name] = []96 self.lines[move.name] = []
100 book_total = 0.0
101 func_total = 0.0
102 book_currency = ''
103 aml_dom = [('move_id', '=', move.id)]97 aml_dom = [('move_id', '=', move.id)]
104 if account_ids:98 if account_ids:
105 aml_dom.append(('account_id', 'in', account_ids))99 aml_dom.append(('account_id', 'in', account_ids))
@@ -235,35 +229,10 @@
235 'func_currency': aml.functional_currency_id and aml.functional_currency_id.name or '',229 'func_currency': aml.functional_currency_id and aml.functional_currency_id.name or '',
236 }230 }
237 self.lines[move.name].append(line)231 self.lines[move.name].append(line)
238 book_total += book_amount or 0.0
239 func_total += func_amount or 0.0
240 # create the total line for each Entry Sequence
241 if self.lines[move.name]:
242 self.total_lines[move.name] = {
243 'book_amount': book_total,
244 'book_currency': book_currency,
245 'func_amount': func_total,
246 }
247 else:
248 # empty total line in case there is no analytic line for this move
249 self.total_lines[move.name] = {}
250 # update percentage of the report loading232 # update percentage of the report loading
251 bg_obj.compute_percent(self.cr, self.uid, current_line_position, len(move_ids), context=context)233 bg_obj.compute_percent(self.cr, self.uid, current_line_position, len(move_ids), context=context)
252 return self.lines234 return self.lines
253235
254 def _get_total_line(self, entry_sequence):
255 """
256 Returns a dict with functional amount, and booking amount & currency for the Entry Seq. in parameter
257 """
258 if entry_sequence in self.total_lines:
259 return self.total_lines[entry_sequence]
260 else:
261 return {
262 'book_amount': 0.0,
263 'book_currency': '',
264 'func_amount': 0.0,
265 }
266
267 def _get_proprietary_instance(self, data):236 def _get_proprietary_instance(self, data):
268 """237 """
269 Returns the code of the Prop. Instance selected in the wizard if any238 Returns the code of the Prop. Instance selected in the wizard if any

Subscribers

People subscribed via source and target branches