Quantcast
Channel: OpenERP Help - Individual question feed
Viewing all articles
Browse latest Browse all 39

What controls existence of Duplicate function in OpenERP7?

$
0
0
I have created a custom module that defines several new models. Some of my custom models should not be duplicated and others should... Of all these models the More drop-down displays the Duplicate option for all the custom models except for two of them. Why not those two? They happen to be the ones I want to be able to duplicate and not any of the others... What ORM logic determines whether or not a model can be copied and how can I override it? As a test I decided to "force" a copy operation as follows: { "jsonrpc":"2.0", "method":"call", "params":{ "model":"dbe.application", "method":"copy", "args":[ 32, { }, { "lang":"en_US", "tz":"America/New_York", "uid":1 } ], "kwargs":{ }, "session_id":"3ebb612049fe4e49a760429632d865ae", "context":{ "lang":"en_US", "tz":"America/New_York", "uid":1 } }, "id":"r7" } This test resulted in a success message and a copy of the original record. I even had an override of the copy method in this model which changes the value of the state field and that also worked. Yet OpenERP still refuses to display Duplicate in the More drop-down. I have searched through the largely undocumented javascript for the UI and found where the bottun is defined as well as it's callback, on_button_duplicate, but nothing useful here to shed light on my problem. Also of interest, looking through old screengrabs from Q/A testers I see that Duplicate used to be available but has mysteriously gone away since then. Reviewing changes to the models since then shows only very minor tweaks to their code - mainly help text on fields. So if Duplicate was there where has it gone and why? Could this have to do with permissions?

Viewing all articles
Browse latest Browse all 39

Trending Articles