跳至内容
菜单
此问题已终结
3716 查看

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

形象
丢弃
相关帖文 回复 查看 活动
1
6月 23
2374
1
4月 23
11501
1
1月 23
2342
1
6月 22
2746
2
8月 20
9219