Skip to Content
Menu
This question has been flagged
2 Replies
5121 Zobrazenia

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

Avatar
Zrušiť
Best Answer

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

Avatar
Zrušiť
Autor Best Answer

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? 

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
mar 19
5188
0
feb 25
1278
0
jan 25
1103
1
dec 24
1407
1
okt 23
1957