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

creation/update: a mandatory field is not correctly set

By
Sergio
on 12/31/13, 7:34 AM 2,036 views

I do an item "Lectura" with the id of "Jornada" and when there isn't the "Jornada" I do it and then do the "Lectura", but I get the error:

  • creation/update: a mandatory field is not correctly set

[object with reference: modelo de la jornada, donde se guarda los eventos de la tarjeta - jornada]

CODE:

def onchange_pasaTarjeta(self,cr,uid,ids,tarjeta_ids): jornadaID = -1; for jornada in self.pool.get("jornada").browse(cr,uid,ids): if jornada.name == time.localtime(time.time())[2]: jornadaID = jornada.id

    if jornadaID != -1:
        self.pool.get("lectura").create(cr,uid,{'hora':(str(time.localtime(time.time())[3])+'.'+str(time.localtime(time.time())[4])),'lector_id':uid,'jornada_id':jornadaID})
    else:
        self.pool.get("jornada").create(cr,uid,{'name':time.localtime(time.time())[2],'festivo':'no'})

        for jornada in self.pool.get("jornada").browse(cr,uid,ids):
            if jornada.name == time.localtime(time.time())[2]:
                jornadaID = jornada.id
        self.pool.get("lectura").create(cr,uid,{'hora':(str(time.localtime(time.time())[3])+'.'+str(time.localtime(time.time())[4])),'lector_id':uid,'jornada_id':jornadaID})

jornada is mandatory field its value is empty that why this error will come. Remove the Required=True it will work...

sridhar
on 12/31/13, 7:36 AM

HI Sridhar, could you post your comment as the answer? You provided the correct answer as a comment, and it is going to be more useful to the community if you post it as the answer to the question.

Gustavo
on 1/1/14, 8:32 AM
0
sridhar
On 1/2/14, 1:02 AM

jornada is mandatory field its value is empty that why this error will come. Remove the Required=True it will work...

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

0 follower(s)

Stats

Asked: 12/31/13, 7:34 AM
Seen: 2036 times
Last updated: 3/16/15, 8:10 AM