Merge lp:~unifield-team/unifield-server/us-1361 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3877
Proposed branch: lp:~unifield-team/unifield-server/us-1361
Merge into: lp:unifield-server
Diff against target: 73 lines (+10/-7)
2 files modified
bin/addons/account_hq_entries/wizard/hq_entries_split.py (+3/-2)
bin/addons/account_hq_entries/wizard/hq_entries_validation.py (+7/-5)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-1361
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+300705@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_hq_entries/wizard/hq_entries_split.py'
--- bin/addons/account_hq_entries/wizard/hq_entries_split.py 2016-03-23 09:07:28 +0000
+++ bin/addons/account_hq_entries/wizard/hq_entries_split.py 2016-07-21 08:17:08 +0000
@@ -291,8 +291,9 @@
291 total = 0.00291 total = 0.00
292 for line in wiz.line_ids:292 for line in wiz.line_ids:
293 total += line.amount293 total += line.amount
294 if abs(wiz.original_amount - total) > 10**-2:294 if abs(abs(wiz.original_amount) - abs(total)) > 0.000000000001:
295 raise osv.except_osv(_('Error'), _('Wrong total: %.2f, instead of: %.2f') % (total or 0.00, wiz.original_amount or 0.00,))295 # US-1361 tolerate minimal python rounding gap
296 raise osv.except_osv(_('Error'), _('Wrong total: %f, instead of: %.2f') % (total or 0.00, wiz.original_amount or 0.00,))
296297
297 self.write(cr, uid, [wiz.id], {'running': True})298 self.write(cr, uid, [wiz.id], {'running': True})
298 # If all is OK, do process of lines299 # If all is OK, do process of lines
299300
=== modified file 'bin/addons/account_hq_entries/wizard/hq_entries_validation.py'
--- bin/addons/account_hq_entries/wizard/hq_entries_validation.py 2016-05-27 10:19:09 +0000
+++ bin/addons/account_hq_entries/wizard/hq_entries_validation.py 2016-07-21 08:17:08 +0000
@@ -89,7 +89,8 @@
89 self.pool.get('free.2.distribution.line').create(cr, uid, common_vals)89 self.pool.get('free.2.distribution.line').create(cr, uid, common_vals)
90 return distrib_id90 return distrib_id
9191
92 def create_move(self, cr, uid, ids, period_id=False, currency_id=False, date=None, journal=None, orig_acct=None, context=None):92 def create_move(self, cr, uid, ids, period_id=False, currency_id=False,
93 date=None, journal=None, orig_acct=None, doc_date=None, context=None):
93 """94 """
94 Create a move with given hq entries lines95 Create a move with given hq entries lines
95 Return created lines (except counterpart lines)96 Return created lines (except counterpart lines)
@@ -125,7 +126,7 @@
125 # create move126 # create move
126 move_id = self.pool.get('account.move').create(cr, uid, {127 move_id = self.pool.get('account.move').create(cr, uid, {
127 'date': date,128 'date': date,
128 'document_date': date,129 'document_date': doc_date or date,
129 'journal_id': journal_id,130 'journal_id': journal_id,
130 'period_id': period_id,131 'period_id': period_id,
131 })132 })
@@ -181,7 +182,7 @@
181 'move_id': move_id,182 'move_id': move_id,
182 'date': date,183 'date': date,
183 'date_maturity': date,184 'date_maturity': date,
184 'document_date': date,185 'document_date': doc_date or date,
185 'name': 'HQ Entry Counterpart',186 'name': 'HQ Entry Counterpart',
186 'currency_id': currency_id,187 'currency_id': currency_id,
187 })188 })
@@ -234,7 +235,7 @@
234 # Create the original line as it is (and its reverse)235 # Create the original line as it is (and its reverse)
235 for line in original_lines:236 for line in original_lines:
236 # PROCESS ORIGINAL LINES237 # PROCESS ORIGINAL LINES
237 res_move = self.create_move(cr, uid, line.id, line.period_id.id, line.currency_id.id, date=line.date, context=context)238 res_move = self.create_move(cr, uid, line.id, line.period_id.id, line.currency_id.id, date=line.date, doc_date=line.document_date, context=context)
238 original_move = aml_obj.browse(cr, uid, res_move[line.id])239 original_move = aml_obj.browse(cr, uid, res_move[line.id])
239240
240 move_id = original_move.move_id.id241 move_id = original_move.move_id.id
@@ -248,7 +249,7 @@
248 aml_obj.write(cr, uid, original_move.id, {'corrected': True, 'have_an_historic': True} , context=context)249 aml_obj.write(cr, uid, original_move.id, {'corrected': True, 'have_an_historic': True} , context=context)
249 original_account_id = original_move.account_id.id250 original_account_id = original_move.account_id.id
250251
251 new_res_move = self.create_move(cr, uid, [x.id for x in line.split_ids], line.period_id.id, line.currency_id.id, date=line.date, journal=od_journal_id, orig_acct=original_account_id)252 new_res_move = self.create_move(cr, uid, [x.id for x in line.split_ids], line.period_id.id, line.currency_id.id, date=line.date, doc_date=line.document_date, journal=od_journal_id, orig_acct=original_account_id)
252 # original move line253 # original move line
253 original_ml_result = res_move[line.id]254 original_ml_result = res_move[line.id]
254 # Mark new journal items as corrections for the first one255 # Mark new journal items as corrections for the first one
@@ -277,6 +278,7 @@
277 'reversal_line_id': original_move.id,278 'reversal_line_id': original_move.id,
278 'partner_txt': original_move.partner_txt or '',279 'partner_txt': original_move.partner_txt or '',
279 'reference': line.ref or ' ', # UFTP-342: if HQ entry reference is empty, do not display anything. As a field function exists for account_move_line object, so we add a blank char to avoid this problem280 'reference': line.ref or ' ', # UFTP-342: if HQ entry reference is empty, do not display anything. As a field function exists for account_move_line object, so we add a blank char to avoid this problem
281 'document_date': line.document_date, # US-1361
280 }, context=context, check=False, update_check=False)282 }, context=context, check=False, update_check=False)
281283
282 # create the analytic lines as a reversed copy of the original284 # create the analytic lines as a reversed copy of the original

Subscribers

People subscribed via source and target branches

to all changes: