Contributors mailing list archives

contributors@odoo-community.org

Browse archives

Avatar

Re: updating module no recreate removed `noupdate="True"` data

by
Iván Todorovich
- 29/03/2021 12:08:56
Hello Pierre,

This already exists in core, you can set the forcecreate="False" or forcecreate="0" to prevent odoo from re-creating a deleted record


I hope it helps :)

Best

Iván Todorovich

Odoo Techno-Functional Consultant



On Mon, 29 Mar 2021 at 06:27, Pierre Verkest <pierreverkest84@gmail.com> wrote:
hum... in fact this would required to overwrite BaseModel, Is there a nice way in v14.0 to change such class from a module ?

I'm not very confident if I overwrite a BaseModel method because if such module is present in the python path it will take place event if the module is not install I suppose.
And I'm not sure how to properly monkey patch BaseModel at run time :thinking:

Le lun. 29 mars 2021 à 11:04, Pierre Verkest <pierreverkest84@gmail.com> a écrit :
Hi there,

I'm wondering if there is any good reason for this default behavior from odoo that if I (as a user) remove a record created by a module using `noupdate="True"` this records is re-created by the ORM at the next update ?

Is there some module that changes that behaviour to let the record unlink while there is ir_model_data record without its related record ?

I'm on the way to suggest ir_model_norecreate module in server-bakend repo to change that behaviour.

I would be happy to hear from you, I think it could be a nice feature for next odoo version and maybe with a new tag `norecreate=True`, any thoughts ?

--
Pierre Verkest
06 81 12 25 20
Github: petrus-v - Twitter: petrusv84 - Linkedin: pierre-verkest


--
Pierre

_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe

Reference