Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
3427 Näkymät

Hey everyone. I'm wondering if there is a way to copy an existing Quality Worksheet Template's design. 

I have already created a server action "Duplicate" for the Worksheet Template model, but haven't written any Python code for it yet. I want to write code that will copy an existing worksheet template's design so that I can reuse its layout but tweak minor things, without having to create the whole template design from scratch. Thanks for your time to help.


Avatar
Hylkää
Tekijä

@Cybrosys Hey, thanks for the reply. Unfortunately this doesn't copy the design template, but rather creates copies of all the quality worksheet templates with blank design templates

Hi,

have you made any progress on this matter @Kristo? I need the same feature and would very much appreciate any help.

Thanks!

Tekijä

No Markus, this was a dead end. I haven't explored the matter further, but you might be able to achieve it by copy/pasting the xml data of the worksheet.

I will need more details around this, but for those who really need it, feel free to contact me in order to develop it

Paras vastaus

Sadly I have not enough karma to "comment". So I'll just have to answer here.
I have tried some inheritance stuff, using the same model as the Worksheet i want to duplicate, without any success. 
It somehow overwrote the already existing worksheet. @Axel what is the best way to contact you? I would be very interested in this feature.

Avatar
Hylkää
Paras vastaus

Hi,

Try the below code

rec = env['worksheet.template'].sudo().search([])
for i in rec:
    i.copy()


Regards

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
heinäk. 24
932
1
syysk. 23
1545
1
kesäk. 23
2671
1
maalisk. 24
3836
0
marrask. 22
2057