Steps to reproduce:
Sales module is installed
mymodule/static/src/xml/newbutton.xml:
<?xml version="1.0" encoding="UTF-8"?>
<template id="template" xml:space="preserve">
<t t-extend="ListView.buttons">
<t t-jquery="button.o_list_button_add" t-operation="after">
<t t-if="widget.model == 'product.template'">
<button class="btn btn-primary btn-sm" type="button">New Button</button>
</t>
</t>
</t>
</template>
- mymodule/manifest.py:
:
'qweb': [
'static/src/xml/newbutton.xml',
],
:
- Upgrade module
Current behavior:
When in Sales Order, new button is not shown. However, when the element <t t-if="widget.model == 'product.template'">
is removed, the New Button is shown in every form.
Expected behavior:
New Button should be shown only in the Sales Order form.
how product.template comes in the sales model? sale.order is the model name of sales and sale.order.line for lines.
Next time please use a meaningful title.