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

Problem with Message on return dictionary values

By
Sandro Regis
on 4/27/14, 12:49 AM 864 views

Hello friend, i need to display a single message on return the quotation calculation, i change the method as i saw hints here in the forum and overall internet but it's not working. Bellow follow the method and the error message that i am facing.

def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
    tax_obj = self.pool.get('account.tax')
    cur_obj = self.pool.get('res.currency')
    res = {}
    if context is None:
        context = {}
    for line in self.browse(cr, uid, ids, context=context):
        price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
        taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)
        cur = line.order_id.pricelist_id.currency_id
        res[line.id] = cur_obj.round(cr, uid, cur, taxes['total'])

    return {'value':res, 'warning':{_("Message"),_("Amount Calculation without erros!")}}

O erro que está surgindo:

2014-04-27 02:37:33,611 17796 ERROR ? openerp.osv.osv: Uncaught exception

Traceback (most recent call last): File "/opt/projetos/openerp/master/server/openerp/osv/osv.py", line 129, in wrapper return f(self, dbname, *args, **kwargs) File "/opt/projetos/openerp/master/server/openerp/osv/osv.py", line 195, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/opt/projetos/openerp/master/server/openerp/osv/osv.py", line 183, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/opt/projetos/openerp/master/server/openerp/osv/orm.py", line 3424, in read result = self._read_flat(cr, user, select, fields, context, load) File "/opt/projetos/openerp/master/server/openerp/osv/orm.py", line 3550, in _read_flat record[f] = res2[record['id']] KeyError: 113

Please any help will be welcome.

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: 4/27/14, 12:49 AM
Seen: 864 times
Last updated: 3/16/15, 8:10 AM