Trying To Add a Button to Invoice Portal View Odoo 16

69 Views Asked by At

I've been trying to add a button to add a signature to the portal view of an invoice in Odoo, I suspect either the problem is with the external id I'm using (or maybe a rights issue?) but I've tried looking up portal external ids on the views section and none of the ones I've tried seem to work,inheriting the views and altering them the traditional way doesn't seem to work, what could be the problem? this is my current implementation


    `<odoo>
        <record id="portal_invoice_signature_button_payment" model="ir.ui.view">
            <field name="name">Portal Invoice Signature Button with Payment</field>
            <field name="model">account.move</field>
            <field name="inherit_id" ref="account_payment.portal_invoice_page_inherit_payment"/>
            <field name="arch" type="xml">
                <!-- Positioning the "Accept and Sign" button below the "Pay Now" button using class -->
                <xpath expr="//div[contains(@class, 'd-grid')]/a[contains(@class, 'btn-primary')]" position="after">
                    <div class="d-grid mt-2">
                        <button type="button" class="btn btn-secondary btn-block" id="acceptAndSign" data-bs-toggle="modal" data-bs-target="#signatureModal">
                            <i class="fa fa-pencil-square-o"/> Accept and Sign
                        </button>
                    </div>
                </xpath>

                <!-- Modal for the signature pad -->
                <xpath expr="//div[@id='invoice_content']" position="before">
                    <div class="modal fade" id="signatureModal" tabindex="-1" aria-labelledby="signatureModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                                    <div class="modal-header">
                                    <h5 class="modal-title" id="signatureModalLabel">Please Sign Below</h5>
                                    <button type="button" class="btn-close" data-bs-dismiss="modal" a ia-label="Close"></button>
                                </div>
                                <div class="modal-body">
                                    <canvas id="signatureCanvas" width="400" height="200"></canvas>
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-secondary" data-bs-    dismiss="modal">Close</button>
                                    <button type="button" class="btn btn-primary"     id="saveSignatureModal">Save Signature</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </xpath>
            </field>
        </record>
    </odoo>`

The goal is to add an Accept and Sign button that is to trigger the Signature UMD I have in my invoice model

I've tried changing the external ids some of the external id's i've been using include the account.portal_invoice_page external id, account_payment.portal_invoice_page_inherit_payment etc etc, I've also added a security file since I thought that might have been causing the button not to appear in the portal view, maybe I could missing something when it comes to the implementation

0

There are 0 best solutions below