Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to update existing record with xml import

By
Roy Nurmi
on 11/2/15, 7:00 AM 654 views

I have extended existing model (product.uom) in a module, and I would like to initialize data to a new field in a xml import using external id to do that, but the import fails to bring data to the new field. No error is raised, just no data is loaded.

Is there some mechanism that "protects" records created in another module from being updated by another module, or should I be able to update existing records using normal xml import?

maybe original record has  noupdate="1" property on record tag?

Temur
on 11/2/15, 8:09 AM
0

Temur

--Temur--
2896
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 11/2/15, 10:53 AM

to update record from python code, a workaround may be to run python code at install/uninstall time as explained there 

then, as you'll have code that runs at install time, you can retrieve needed record using it's xml id (or external id as it often referred) in python code and update it's fields per your needs.

0
Roy Nurmi
On 11/2/15, 8:14 AM

Yes, it seems it has:

openerp> <data noupdate="1"> <!-- Resource: product.uom.categ -->.

Is there any way around this?

Yes, you can update record using python code

Temur
on 11/2/15, 10:34 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/2/15, 7:00 AM
Seen: 654 times
Last updated: 11/2/15, 10:54 AM