Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
5135 Vues

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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Auteur Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
mars 19
5211
0
févr. 25
1291
0
janv. 25
1110
1
déc. 24
1426
1
oct. 23
1977