Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3756 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 23
2479
1
thg 4 23
11579
1
thg 1 23
2418
1
thg 6 22
2827
2
thg 8 20
9332