Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
10580 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Yes, it seems it has:

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

Is there any way around this?

Ảnh đại diện
Huỷ bỏ

Yes, you can update record using python code