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

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?

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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">
Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
jouluk. 23
15270
0
lokak. 23
33
3
lokak. 23
790
1
lokak. 23
569
1
elok. 23
2753