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

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.1-opw-574543-pso/+merge/104692

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.1-opw-574543-pso/+merge/104692
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-574543-pso.
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py	2012-03-30 11:07:16 +0000
+++ account_voucher/account_voucher.py	2012-05-04 07:16:21 +0000
@@ -192,7 +192,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, voucher_currency, context=None):
         context = context or {}
@@ -221,7 +221,7 @@
             for l in voucher.line_cr_ids:
                 credit += l.amount
             currency = voucher.currency_id or voucher.company_id.currency_id
-            res[voucher.id] =  currency_obj.round(cr, uid, currency, abs(voucher.amount - abs(credit - debit)))
+            res[voucher.id] =  currency_obj.round(cr, uid, currency, abs(abs(voucher.amount) - abs(credit - debit)))
         return res
 
     def _paid_amount_in_company_currency(self, cr, uid, ids, name, args, context=None):

=== modified file 'account_voucher/invoice.py'
--- account_voucher/invoice.py	2011-10-27 21:11:24 +0000
+++ account_voucher/invoice.py	2012-05-04 07:16:21 +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,

_______________________________________________
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