Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
9226 Zobrazení

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})
Avatar
Zrušit

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

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.

Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
bře 15
4481
1
čvn 19
5445
1
pro 23
20829
1
čvn 18
3381
4
led 17
7815