Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

How can I update a record stored with the attribute noupdate="1"?

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
6 Respuestas
49001 Vistas
Avatar
Robin Chatfield

I have a module that got the noupdate="1" attribute added to all views, actions and menuitems. Now those records can't be upgraded, even after the xml file in the module has been corrected. I'm already using the module, and would rather not have to reinstall it and lose the data.

Some options I've considered:

Find where the noupdate attribute is stored in the database, and change it for my records. Does anyone know how this can be done?

Delete all the records from the database. Tried it, and it works. Unfortunately the db crashes before I've goten all the records, and then I have to restore and am back to square one.

Export the data, uninstall module, reinstall, and import the data again.

4
Avatar
Descartar
Mansi Kariya (mka)

Do you want to improve those views?

CARLOS ALBERTO GARCIA BRIZUELA

The first answer in this web page works well for me:

https://stackoverflow.com/questions/38995280/in-odoo-how-to-force-overwriting-of-a-record-rule-which-is-defined-in-a-base-mod

Avatar
Muhammad Awais
Mejor respuesta

For version 16.0

<function name="write" model="ir.model.data">
<value model="ir.model.data" search="[('module', '=', 'base'), ('name', '=', 'res_partner_rule_private_employee')]"/>
<value eval="{'noupdate': False}"/>
function>

<record id="base.res_partner_rule_private_employee" model="ir.rule">
<field name="groups" eval="[Command.set([ref('base.group_system')])]"/>
record>

<function name="write" model="ir.model.data">
<value model="ir.model.data" search="[('module', '=', 'base'), ('name', '=', 'res_partner_rule_private_employee')]"/>
<value eval="{'noupdate': True}"/>
function>

3
Avatar
Descartar
Avatar
Muhammad Irfan
Mejor respuesta

Other answers are okay, but if you want to do it using a XML file inside a module, you can try to do the following (change the model based on your needs):

<function name="write" model="ir.model.data">

            <!-- First we need to find the record...-->

            <function name="search" model="ir.model.data">

                <value

                  eval="[('module', '=', 'purchase'), ('name', '=', 'purchase_order_comp_rule')]"

                  />

            </function>

           <!-- ...and temporarily set the noupdate field to False-->

            <value eval="{'noupdate': False}" />

        </function>

       <!-- Get our main job done, i.e. modify the domain_force field of a record -->

        <record id="purchase.purchase_order_comp_rule" model="ir.rule">

            <field name="domain_force">[('company_id','=',user.company_id.id)]</field>

        </record>

       <!-- (Optional) Time to clean our dirty hand, set the previously noupdate False to True again -->

        <function name="write" model="ir.model.data">

            <function name="search" model="ir.model.data">

                <value

                  eval="[('module', '=', 'purchase'), ('name', '=', 'purchase_order_comp_rule')]"

                  />

            </function>

            <value eval="{'noupdate': True}" />

        </function>


Hope it helps!

*Sorry i'm not using the code tag to put the code above, for unknown reasons it behaves strangely.

22
Avatar
Descartar
Jose Gpe Osuna

Thank you! I really liked this option

Pranav P S

Thanks a lot irfan...you made my day

S****** D******

Muhammad, your proposal is really nice.

It worked on a first try for me.

But in an other case, it does not work anymore.

I try to modify a sequence.

<function name="write" model="ir.sequence">

<function name="search" model="ir.sequence">

<value eval="[('module', '=', 'account'), ('name', '=', 'sequence_payment_customer_invoice')]"/>

</function>

<value eval="{'noupdate': False}" />

</function>

I have the following error :

"Invalid field 'module' in leaf "<osv.ExtendedLeaf: ('module', '=', 'account') on ir_sequence (ctx: )>

Dimas Aditya Kristianto

For future people. This is working in odoo 16. BUT!!! remove any comment inside the function tag. Because somehow odoo read it as passing argument. At least that was what happen to me. I will give this answer an upvote anyway (because it's working)

Avatar
Habib
Mejor respuesta

Records that are created in xml files also create an external identifier which is named [module name].[id]

When noupdate="1" is specified in the xml data file, then the external identifier created has a field called noupdate set to True. Once this happens, it is impossible to update a record using xml.

You can find the external identifier in Technical -> Sequences and Identifiers -> External Identifiers. Find the id of the record you're looking for and uncheck the noupdate field. Once this is done, you can update the record using your xml data file.

I had a requirement for a module to update existing records which were previously set to noupdate. This had to be done in xml. To achieve this I did the following in the data file (new_module_data.xml)

1.I deleted the record

2. I re-created the record using the original identifier

<openerp>
<data noupdate="0">
<delete id="old_module_name.identifier" model="old_module_name.model"/>
<record id="old_module_name.identifier" model="old_module_name.model">
...
</record>
</data>
</openerp>
5
Avatar
Descartar
omar ahmed

i used your answer and it works but i have 2 questions :

1 - is ID of new record must be like the old one ?

2 - is there any dangerous to delete this record ?

thanks

Oleksandr Komarov

If model have a links with other models,

which launched as cascade delete,

then you got a problem in record

<delete id="old_module_name.identifier" model="old_module_name.model"/>

Avatar
Ivan
Mejor respuesta

The noupdate is stored in the ir_model_data table.  Just change the noupdate column to FALSE for the record (search it using the XML ID against the name column).  This will allow you to make "noupdate" records to be updateable in the future.

If you want to just change something in the records created by the data XML, I would recommend that you just change it via the application, e.g. for ir.ui.view --> through Settings >> Technical >> User Interface >> Views.

4
Avatar
Descartar
Avatar
Mokrani lilya
Mejor respuesta

Thanks a lot! @ Muhammad Irfan

It worked for me but without comments


name="write" model="ir.model.data">
name="search" model="ir.model.data">
eval="[('module', '=', 'sale'), ('name', '=', 'sale_order_personal_rule')]" />

eval="{'noupdate': False}"/>







1
Avatar
Descartar
Avatar
Jasmin Hirani
Mejor respuesta

Your solution is right but the syntax have a little correction.  For any Function in version 18.0 


<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'purchase'), ('name', '=', 'seq_purchase_order')]"/>
</function>
<value eval="{'noupdate': False}"/>
</function>

<record id="purchase.seq_purchase_order" model="ir.sequence">
<field name="Your Field"> Your Changes of Value </field>
</record>

<function name="write" model="ir.model.data">
<function name="search" model="ir.model.data">
<value eval="[('module', '=', 'purchase'), ('name', '=', 'seq_purchase_order')]"/>
</function>
<value eval="{'noupdate': True}"/>
</function>

0
Avatar
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

Sitio web hecho con

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now