Odoo Help


Custom field in Sale Order?

on 5/5/14, 11:40 AM 941 views

Hello Team

I new in development OpenERP and I have an issue with onchange in view Form. Version OpenERP 7.0

  1. I create a new table/model -> "x_ref.interna" with some fields and I link with sale.order object.
  2. I modify sale.order.form with: ... .... <field name="x_name" on_change="onchange_cirugia_id(x_name, context)" widget="selection"/>
    .... ....
  3. I modify sale.py in addons/sale with the following code:

    def onchange_cirugia_id(self, cr, uid, ids, x_name_id, context=None): val = {} if x_name_id: cirugia = self.pool.get('x_ref.interna').browse(cr, uid, x_name_id, context=context) val['x_paciente'] = cirugia.x_paciente return {'value': val}

  4. I restart openerp server and when I try to create a new sales order I receive the following error in sale.order.form

File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 187, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/usr/lib/pymodules/python2.7/openerp/addons/sale/sale.py", line 342, in onchange_cirugia_id

TypeError: cannot concatenate 'str' and 'int' objects

Can you help me about this problem?

Thanks in advance

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

0 follower(s)


Asked: 5/5/14, 11:40 AM
Seen: 941 times
Last updated: 3/16/15, 8:10 AM