Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
125 Представления

I'm trying to add a Button in Accounting/Customers/Customers in Customer Statement. 
I'm trying to inherit this

<t t-name="account_reports.AccountReportFiltersCustomizable">

Here is my code.

<?xml version="1.0" encoding="UTF-8"?>
<templates>
<!-- Inherit the base account report filters template -->
<t t-name="sale_detail_report.AddButton" t-inherit="account_reports.AccountReportFiltersCustomizable">
<xpath expr="//div[@id='filter_rounding_unit']" position="after">
<button>Testing Button</button>
</xpath>
</t>
</templates>

But "Testing Button" is not added. i have also added account_reports in depends and added 

'assets': {
        'web.assets_backend': [
            'sale_detail_report/static/src/components/**/*',
        ],
    },

in __manifest__ file.
...................................
What is the Problem?????????

Аватар
Отменить
Лучший ответ

Hi,


Move your template into the web.assets_qweb section of your manifest, like this:


'assets': {

    'web.assets_qweb': [

        'sale_detail_report/static/src/xml/*.xml',

    ],

},


Then move your XML file (with your <t> tag) into:


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

<templates>

    <t t-name="sale_detail_report.AddButton" t-inherit="account_reports.AccountReportFiltersCustomizable" t-inherit-mode="extension">

        <xpath expr="//div[@id='filter_rounding_unit']" position="after">

            <button type="button" class="btn btn-primary">Testing Button</button>

        </xpath>

    </t>

</templates>


Hope it helps

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
окт. 25
137
0
окт. 25
161
0
окт. 25
16
0
окт. 25
2
0
окт. 25
235