Amit Bhavsar (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-986088-amb into 
lp:openobject-addons.

Requested reviews:
  Stefan Rijnhart (Therp) (stefan-therp)
  OpenERP Core Team (openerp)
  Amit Parik (OpenERP) (amp-openerp)
Related bugs:
  Bug #986088 in OpenERP Addons: "[trunk/6.1]account_payment Cannot import move 
lines without an invoice"
  https://bugs.launchpad.net/openobject-addons/+bug/986088

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-986088-amb/+merge/103286

Hello,

Fixes the "Integrity Error : null value in column "currency" violates not-null 
constraint"
problem.


I have Improve the code. it's suitable for the multi company environment.

Thanks


-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-986088-amb/+merge/103286
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-986088-amb.
=== modified file 'account_payment/wizard/account_payment_order.py'
--- account_payment/wizard/account_payment_order.py	2012-06-05 11:51:00 +0000
+++ account_payment/wizard/account_payment_order.py	2012-08-28 06:50:26 +0000
@@ -88,7 +88,7 @@
                     'partner_id': line.partner_id and line.partner_id.id or False,
                     'communication': line.ref or '/',
                     'date': date_to_pay,
-                    'currency': line.invoice and line.invoice.currency_id.id or False,
+                    'currency': line.invoice and line.invoice.currency_id.id or line.journal_id.currency.id or line.journal_id.company_id.currency_id.id,
                 }, context=context)
         return {'type': 'ir.actions.act_window_close'}
 
@@ -120,4 +120,4 @@
 
 payment_order_create()
 
-# 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