Odoo Help


adding currency to quotation

on 11/3/15, 5:10 AM 575 views

hello i need to add currency to quotation model. here is my code: 

from openerp.osv import osv, fields

import openerp.addons.decimal_precision as dp

class SaleOrder(osv.osv):

_inherit = 'sale.order'

_columns = {

'expiry': fields.datetime("Quotation Expiry Date"),

'ord_lead_time': fields.many2one(


"ORD Lead-Time"),

'requestor_po': fields.char("Requestor PO"),

'incoterm_id': fields.many2one(

'stock.incoterms', 'Incoterm',

help="International Commercial Terms are a series of predefined commercial terms "),

'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement.')


class SaleOrderLine(osv.osv):

_inherit = 'sale.order.line'

def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,

uom=False, qty_uos=0, uos=False, name='', partner_id=False,

lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, order_line_label=False, flag=False, context=None):

context = context or {}

res = super(SaleOrderLine, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty,

uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,

lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag, context=context)

return {'value': {'price_unit':price_unit*line.order_id.currency.rate}}

i need to call the currency rate from sale order current id how can i do this?

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/3/15, 5:10 AM
Seen: 575 times
Last updated: 11/3/15, 5:15 AM