Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
5120 Переглядів

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
5187
0
лют. 25
1278
0
січ. 25
1103
Field service upgrade Вирішено
1
груд. 24
1405
1
жовт. 23
1956