Odoo V11 - Overwrite information for a given field in the database

Asked

Viewed 18 times

0

I am making a filter to locate the id of a record, and from there update certain fields... I am able to locate the records but I am not able to overwrite the information.

        if validar_voo:
            logger.info("Entrei aki")
            logger.info(validar_voo[0].nom_localidade)
            voos_dict = {}
            if validar_voo[0].nom_localidade != voo.NOM_LOCALIDADE:
                logger.info(voos_dict)
                voos_dict['nom_localidade'] = voo.NOM_LOCALIDADE
            if validar_voo[0].hor_conf != voo.HOR_CONF:
                voos_dict['hor_conf'] = voo.HOR_CONF
            if validar_voo[0].dsc_equipamento != voo.DSC_EQUIPAMENTO:
                voos_dict['dsc_equipamento'] = voo.DSC_EQUIPAMENTO
            if validar_voo[0].dsc_status != voo.DSC_STATUS:
                voos_dict['dsc_status'] = voo.DSC_STATUS
            if voos_dict != {}:
                logger.info(validar_voo)
                voos = consulta_partidas.write(voos_dict)

Complete Code

1 answer

0

Silly error of logic

wrong: flights = query departure.write(voos_dict) correct: flights = validar_voo.write(voos_dict)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.