Odoo Help

0

Custom field in Sale Order?

By
jsallent
on 5/5/14, 11:40 AM 1,080 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

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.

Register

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)

Stats

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