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

adding currency to quotation

By
JP
on 11/3/15, 5:10 AM 292 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(

'account.payment.term',

"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?

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

1 follower(s)

Stats

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