Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5369 มุมมอง

Hello, I want to inherit base common button template in custom module. I work with odoo V10
A try this : 

<?xml version="1.0" encoding="UTF-8"?>

<templates id="web.template" xml:space="preserve">

<xpath expr="//button" position="relace">

<button type="button" t-attf-class="btn btn-sm #{widget.node.attrs.class or ''}"

t-att-style="widget.node.attrs.style"

t-att-tabindex="widget.node.attrs.tabindex"

t-att-autofocus="widget.node.attrs.autofocus"

t-att-accesskey="widget.node.attrs.accesskey">

<t t-if="widget.node.attrs.icon">

<img t-if="!widget.fa_icon" t-att-src="widget.node.attrs.icon" style="color:green"/>

<div t-if="widget.fa_icon" t-attf-class="fa fa-fw #{widget.node.attrs.icon} o_button_icon" style="color:green"/>

</t>

<span t-if="widget.string"><t t-esc="widget.string"/></span>

</button>

</xpath>

</templates>

and this : 

<?xml version="1.0" encoding="UTF-8"?>

<templates id="web.template" xml:space="preserve">

<t t-name="CapWidgetButton" t-extend="WidgetButton">

<t t-jquery='button' t-operation='replace'>

<button type="button" t-attf-class="btn btn-sm #{widget.node.attrs.class or ''}"

t-att-style="widget.node.attrs.style"

t-att-tabindex="widget.node.attrs.tabindex"

t-att-autofocus="widget.node.attrs.autofocus"

t-att-accesskey="widget.node.attrs.accesskey">

<t t-if="widget.node.attrs.icon">

<img t-if="!widget.fa_icon" t-att-src="widget.node.attrs.icon" style="color:green"/>

<div t-if="widget.fa_icon" t-attf-class="fa fa-fw #{widget.node.attrs.icon} o_button_icon" style="color:green"/>

</t>

<span t-if="widget.string"><t t-esc="widget.string"/></span>

</button>

</t>

</t>

</templates>

But i doesn't work. Have you any idea ?


อวตาร
ละทิ้ง

First You Have to Inherit Template id(web.template) than Use x-path

and On This Line <xpath expr="//button" position="relace"> position="replace"

ผู้เขียน

Thanks ! But it's not the problem, i've always the same error message :

AssertionError: Document does not comply with schema

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ส.ค. 24
2136
1
มี.ค. 24
1682
18
ธ.ค. 22
37807
2
ธ.ค. 22
32625
2
พ.ย. 21
8655