Priyesh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-574543-pso into 
lp:openobject-addons/6.0.

Requested reviews:
  Xavier ALT (OpenERP) (xal-openerp)
Related bugs:
  Bug #865854 in OpenERP Addons: "Payment to Sales/Purchase Refund Invoice is 
wrong"
  https://bugs.launchpad.net/openobject-addons/+bug/865854

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-574543-pso/+merge/105790

Hello,

Fixed issues:
1. Refund time, Paid amount should come up with negative amount.
2. Difference amount coming with wrong value.

Kindly review it.

Thanks,
Priyesh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-574543-pso/+merge/105790
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-574543-pso.
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2012-03-20 07:20:19 +0000
+++ account_voucher/account_voucher.py	2012-05-15 10:13:19 +0000
@@ -154,7 +154,7 @@
             debit += l['amount']
         for l in line_cr_ids:
             credit += l['amount']
-        return abs(amount - abs(credit - debit))
+        return abs(abs(amount) - abs(credit - debit))
 
     def onchange_line_ids(self, cr, uid, ids, line_dr_ids, line_cr_ids, amount):
         if not line_dr_ids and not line_cr_ids:
@@ -172,7 +172,7 @@
                 debit += l.amount
             for l in voucher.line_cr_ids:
                 credit += l.amount
-            res[voucher.id] =  abs(voucher.amount - abs(credit - debit))
+            res[voucher.id] =  abs(abs(voucher.amount) - abs(credit - debit))
         return res
 
     _name = 'account.voucher'
@@ -539,6 +539,7 @@
                         amount = min(amount_unreconciled, abs(total_credit))
                         rs['amount'] = amount
                         total_credit -= amount
+            rs['amount'] = abs(rs['amount'])
 
             default['value']['line_ids'].append(rs)
             if rs['type'] == 'cr':

=== modified file 'account_voucher/invoice.py'
--- account_voucher/invoice.py	2011-01-14 00:11:01 +0000
+++ account_voucher/invoice.py	2012-05-15 10:13:19 +0000
@@ -40,7 +40,7 @@
             'domain': '[]',
             'context': {
                 'default_partner_id': inv.partner_id.id,
-                'default_amount': inv.residual,
+                'default_amount': inv.type in ('in_refund', 'out_refund') and -inv.residual or inv.residual,
                 'default_name':inv.name,
                 'close_after_process': True,
                 'invoice_type':inv.type,
@@ -51,4 +51,4 @@
 
 invoice()
 
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to