Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
215 Lượt xem

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?????????

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 11 25
148
1
thg 11 25
625
5
thg 11 25
2153
1
thg 11 25
586
1
thg 10 25
225