Skip to Content
Menu
This question has been flagged
1 Reply
730 Views

Hello everyone, i am trying to make some modification in odoo POS and when i try to run the code I'm getting an error. The error is pointing to an xml file that i just added and I will paste below, any expert to help?

Error: AssertionError: Document does not comply with schema


here is my XML
(Check first comment for the code)

Avatar
Discard
Author

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_button.PaymentScreenButtons"
t-inherit="point_of_sale.PaymentScreenButtons"
t-inherit-mode="extension">
<xpath expr="//div[contains(@class, 'payment-buttons')]" position="inside">
<button class="button button-partial-payment btn btn-light py-3 text-start rounded-0 border-bottom"
t-on-click="createAndPrintInvoice">
<i class="fa fa-money me-2"/>Custom Button
</button>
</xpath>
</t>
</templates>

Best Answer

you have to close the I tag explicitly...


  Custom Button

The because XML requires explicit closing of tags

Avatar
Discard
Author

Can you give me more information, I don't seem to understand

Sorry the code was changed after posting...

In your XML code, you have a < i class that you tried to close with /> but you have to write something like:
< i class = "fa fa-money me-2"> < / i > (I added spaces here to avoid that it is modified) .

So you have to explicitly close the <i tag with a </ i>

Author

<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="pos_button.PaymentScreenButtons"
t-inherit="point_of_sale.PaymentScreenButtons"
t-inherit-mode="extension">
<xpath expr="//div[contains(@class, 'payment-buttons')]" position="inside">
<button class="button button-partial-payment btn btn-light py-3 text-start rounded-0 border-bottom"
t-on-click="createAndPrintInvoice">
<i class="fa fa-money me-2"></i>Custom Button
</button>
</xpath>
</t>
</templates>