Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
6 Respostes
48995 Vistes
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
Best Answer

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
Best Answer

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
Best Answer

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
Best Answer

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
Best Answer

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
Best Answer

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
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

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