Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

onchange fields, Error : Internal Server Error<

By
huongcute
on 8/29/14, 12:36 AM 1,310 views

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

0
Jacky
On 8/29/14, 2:24 AM

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

0
huongcute
On 8/29/14, 2:45 AM

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? 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 8/29/14, 12:36 AM
Seen: 1310 times
Last updated: 3/16/15, 8:10 AM