Merge lp:~openerp-dev/openobject-addons/6.1-opw-579376-ado into lp:openobject-addons/6.1

Proposed by Amit Dodiya (OpenERP)
Status: Work in progress
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579376-ado
Merge into: lp:openobject-addons/6.1
Diff against target: 17 lines (+2/-2)
1 file modified
account_voucher/account_voucher.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579376-ado
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Fixing
Xavier ALT Pending
Review via email: mp+125412@code.launchpad.net

Description of the change

Hello,

"[FIX] warning message string is wrong while paying the invoice"

String in warning message is wrong.

Regards,
Amit Dodiya

To post a comment you must log in.
Revision history for this message
Ray Carnes (rcarnes) wrote :

The fix should grab the field name from the database, not be hard coded.

Hard-coding field names in python is not a good practice if users can easily change the field names in the UI, then the message would be very confusing.

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Needs Fixing
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6997. By Amit Dodiya<email address hidden>

[FIX] warning message is wrong while paying the invoice

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2012-08-28 10:58:11 +0000
+++ account_voucher/account_voucher.py 2012-09-20 05:19:20 +0000
@@ -926,11 +926,11 @@
926 if amount_residual > 0:926 if amount_residual > 0:
927 account_id = line.voucher_id.company_id.expense_currency_exchange_account_id927 account_id = line.voucher_id.company_id.expense_currency_exchange_account_id
928 if not account_id:928 if not account_id:
929 raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Income Currency Rate' on the company! "))929 raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate Account' on the company! "))
930 else:930 else:
931 account_id = line.voucher_id.company_id.income_currency_exchange_account_id931 account_id = line.voucher_id.company_id.income_currency_exchange_account_id
932 if not account_id:932 if not account_id:
933 raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Expense Currency Rate' on the company! "))933 raise osv.except_osv(_('Warning'),_("Unable to create accounting entry for currency rate difference. You have to configure the field 'Income Currency Rate Account' on the company! "))
934 # Even if the amount_currency is never filled, we need to pass the foreign currency because934 # Even if the amount_currency is never filled, we need to pass the foreign currency because
935 # the receivable/payable account may have a secondary currency, which render this field mandatory935 # the receivable/payable account may have a secondary currency, which render this field mandatory
936 account_currency_id = company_currency <> current_currency and current_currency or False936 account_currency_id = company_currency <> current_currency and current_currency or False