콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
5389 화면

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

관련 게시물 답글 화면 활동
1
8월 24
2146
1
3월 24
1693
18
12월 22
37835
2
12월 22
32659
2
11월 21
8674