> WARNING 11_test1 odoo.addons.base.ir.ir_ui_view: Error-prone use of
> @class in view report_invoice_document
> (account_invoice_report.report_invoice_document): use the
> hasclass(*classes) function to filter elements by their classes
有人可以解释我为什么会收到这个警告。仅在2个地方使用班级。
<td class="text-right">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), l.invoice_line_tax_ids))"/>
</td>
和
<xpath expr="//div[@class='row mt32 mb32']/div[@t-if='o.name']" position="replace"/>
答案 0 :(得分:4)
You can use hasclass() now. Example-
xpath expr="//div[hasclass('dropdown')]" position="replace">
xpath expr="//div[hasclass('dropdown','btn-group','dropdown_sorty_by')]" position="replace">
In your case it should be:
<xpath expr="//div[hasclass('row','mt32','mb32')]/div[@t-if='o.name']" position="replace"/>