Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
5124 Представления

Hi every body, I have an error :

XmlHttpRequestError INTERNAL SERVER ERROR

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <title>500 Internal Server Error</title> <h1>Internal Server Error</h1> <p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>

I dont know how do I fix it. Can you help me?

This is code .py

class danh_sach_kl(osv.Model):
    _name = 'danh.sach.kl'
    _inherit = 'danh.sach.nv'
    _rec_name = 'ly_do_kl'
    
    def onchange_ma_nv(self, cr, uid, ids, ma_nv, context = None):
         v={}
         if ma_nv:
             ma = self.pool.get('danh.sach.nv').browse(cr, uid , ma_nv, context = context)
             v['ten_nv']= ma.ten_nv
             v['ngay_sinh'] = ma.ngay_sinh
             v['ten_bp'] = ma.ten_bp
             v['ten_cd'] = ma.ten_cd
         return {'value':v}
    

    _columns={
              'ma_nv':fields.many2one('danh.sach.nv', 'Mã NV'),
              
              'lan_kl': fields.char('Lần kỷ luật',size = 10),
              'ly_do_kl':fields.char('Lần kỷ luật',size = 10),
              'hinh_thuc':fields.related('ly_do_kl','hinh_thuc',type = 'char',size = 50, string = 'Hình thức kỷ luât'),
              }

 

If I used two fields in function onchange: It works . but when I increase the number of fields , I have an error, .Anybody can explain it to help me?

 

Thanks all

Аватар
Отменить
Лучший ответ

Please check whether there is an onchange function already exist for any of these fields.

Аватар
Отменить
Автор Лучший ответ

Hi Jacky ! I think I creat fields onchange in this class. So it works in that class. this problem is number fields in _def onchange:

When I used two fields then it works well. but I used more than two fields , I have an  this error

I dont know why?

Can you help me? 

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
мар. 19
5196
0
февр. 25
1279
0
янв. 25
1105
1
дек. 24
1411
1
окт. 23
1967