Merge lp:~openerp-dev/openobject-addons/6.0-opw-383540-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 5098
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-383540-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 34 lines (+3/-3)
2 files modified
account/account_move_line.py (+2/-2)
account_voucher/account_voucher.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-383540-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+94745@code.launchpad.net

Description of the change

Hello,

When we provide secondary currency in account and try paying through voucher, then it raises warning to provide write off account even if we have already provided it.

Improved argument for method reconcile() and partial_reconcile(), passed write off account, journal and period.

Please review it.

Regards,
Rifakat

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Unmerged revisions

5098. By Rifakat Husen (OpenERP)

[FIX] account, account_vocuher: added argument of writeoff account, journal, period in reconcile() and reconcile_partial()

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2012-01-10 14:42:15 +0000
3+++ account/account_move_line.py 2012-02-27 10:19:21 +0000
4@@ -726,7 +726,7 @@
5 )
6 return cr.fetchone()
7
8- def reconcile_partial(self, cr, uid, ids, type='auto', context=None):
9+ def reconcile_partial(self, cr, uid, ids, type='auto', context=None, writeoff_acc_id=False, writeoff_period_id=False, writeoff_journal_id=False):
10 move_rec_obj = self.pool.get('account.move.reconcile')
11 merges = []
12 unmerge = []
13@@ -755,7 +755,7 @@
14 unmerge.append(line.id)
15 total += (line.debit or 0.0) - (line.credit or 0.0)
16 if self.pool.get('res.currency').is_zero(cr, uid, company_currency_id, total):
17- res = self.reconcile(cr, uid, merges+unmerge, context=context)
18+ res = self.reconcile(cr, uid, merges+unmerge, context=context, writeoff_acc_id=writeoff_acc_id, writeoff_period_id=writeoff_period_id, writeoff_journal_id=writeoff_journal_id)
19 return res
20 r_id = move_rec_obj.create(cr, uid, {
21 'type': type,
22
23=== modified file 'account_voucher/account_voucher.py'
24--- account_voucher/account_voucher.py 2012-02-24 14:14:41 +0000
25+++ account_voucher/account_voucher.py 2012-02-27 10:19:21 +0000
26@@ -794,7 +794,7 @@
27 move_pool.post(cr, uid, [move_id], context={})
28 for rec_ids in rec_list_ids:
29 if len(rec_ids) >= 2:
30- move_line_pool.reconcile_partial(cr, uid, rec_ids)
31+ move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=inv.writeoff_acc_id.id, writeoff_period_id=inv.period_id.id, writeoff_journal_id=inv.journal_id.id)
32 return True
33
34 def copy(self, cr, uid, id, default={}, context=None):