Skip to Content
Menu
This question has been flagged
1 Reply
4930 Views

I am going crazy with OpenERP duplicate, if I duplicate a User in Employee Directory it duplicates everything (every user of the system), If I duplicate a group it duplicates only some stuff, apparently it doesn't create a copy... If I copy a Menu it doesn't duplicate the submenu options.

WTF does duplicate do "under the hood"? Is duplicate the same as copy? Does it create a new reference that points to the same object? Is it a shallow or a deep copy?

I am on OpenERP 7 LTS.

Avatar
Discard
Best Answer

It depends....

In a normal way it's going to duplicate everything. If your object has a one2many record it's going to duplicate them too. So they are not going to be pointed to the same one.

But....here comes the exception, some objects override the way of copy function. They can avoid some fields, or have a particular way to do it. Each object can have a particular way to handle copies.

For example if you are going to duplicate a done sale order, this new document must not be a new copy of a done sale order, this only has to copy order lines and leave the sale order in draft. So by code it's going to do something different than duplicating a product.

Avatar
Discard