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

0

I am making a filter to find the id of a record, and from there to update certain fields ... I am able to locate the records but I can not 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)

Full Code

    
asked by anonymous 26.10.2018 / 22:50

1 answer

0

Silly Logic Error

wrong: flights = share.write (flights_dict) correct: flights = validar_voo.write (flights_dict)

    
27.10.2018 / 18:09