跳至内容
菜单
此问题已终结
2 回复
4278 查看

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.


形象
丢弃
编写者

@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!

编写者

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

最佳答案

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.

形象
丢弃
最佳答案

Hi,

Try the below code

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


Regards

形象
丢弃
相关帖文 回复 查看 活动
0
7月 24
1832
1
9月 23
2321
1
6月 23
3425
1
3月 24
4904
0
11月 22
2800