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

Hi,
I have to add a field in the change document template view.I tried xpath the existing template and adding the field. But it doesn’t work.
Can anyone help?

形象
丢弃
最佳答案

Hi,

Along with xpath the new field to the template try the below code also

class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'

def change_report_template(self):
res = super(ResConfigSettings, self).change_report_template()
template = self.env.ref(module_name.custom_template_id') #This replace original template by the custom template which you created.
return res

In the above function you can pass your template which the new field added.

Hope it helps

形象
丢弃
最佳答案

You must give a little code so that one can give exact answer. But this is one way of xpathing templates

<xpath expr="//div[hasclass('row', 'mt32')]" position="inside">
形象
丢弃
相关帖文 回复 查看 活动
2
12月 23
15309
0
10月 23
33
3
10月 23
790
1
10月 23
569
1
8月 23
2769