Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How can i show the value of invoice in company currencies while doing invoices i openerp v7.0?

By
samba
on 7/13/14, 3:19 AM 1,221 views

My company currency: INR. In the invoice i have selected "USD" currency. The invoice total showing in USD. I want to add one more total column to show invoice total in INR. How can i do this in openerp version 7.0? 

 

I got like this... Inherit the module like class account_invlice_extension(osv.osv): _inherit = "account.invoice" def _paid_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): if context is None: context = {} res = {} ctx = context.copy() for v in self.browse(cr, uid, ids, context=context): voucher = self.browse(cr, uid, v.id, context=ctx) res[voucher.id] = self.pool.get('res.currency').compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, voucher.amount_total, context=ctx) return res _columns = { 'amount_toatl_cc':fields.function(_paid_amount_in_company_currency, type='float', digits_compute=dp.get_precision('Account'), string='Amount in Home Cur.',digits=(12,6)), } and show this amount_total_cc in view

samba
on 7/24/14, 9:42 AM

I got like this... Inherit the module like class account_invlice_extension(osv.osv): _inherit = "account.invoice" def _paid_amount_in_company_currency(self, cr, uid, ids, name, args, context=None): if context is None: context = {} res = {} ctx = context.copy() for v in self.browse(cr, uid, ids, context=context): voucher = self.browse(cr, uid, v.id, context=ctx) res[voucher.id] = self.pool.get('res.currency').compute(cr, uid, voucher.currency_id.id, voucher.company_id.currency_id.id, voucher.amount_total, context=ctx) return res _columns = { 'amount_toatl_cc':fields.function(_paid_amount_in_company_currency, type='float', digits_compute=dp.get_precision('Account'), string='Amount in Home Cur.',digits=(12,6)), } and show this amount_total_cc in view

samba
on 7/24/14, 9:45 AM

I tied to use your solution but when I try to click or save an invoice it gives me this error : " File "/home/dbm/workspace_2/OpenERPv7/openerp/osv/fields.py", line 1151, in get elif result.get(id): AttributeError: 'NoneType' object has no attribute 'get' "

Othmane Ghandi (Usman BEK)
on 10/15/14, 6:31 AM

Please ! I need your help as soon as possible ! Mr Samba

Othmane Ghandi (Usman BEK)
on 10/15/14, 6:33 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 7/13/14, 3:19 AM
Seen: 1221 times
Last updated: 3/16/15, 8:10 AM