Skip to Content
Menu
This question has been flagged
3 Replies
6059 Views

I am developing a custom module for Odoo 16.
This module adds a form to the /open-account-b2b route that creates a contact and if desired, also creates a SEPA payment mandate.
I know that on Odoo, it's possible to have a signature field where you can draw, upload or automatically generate a signature. I'd like to add this field to my XML view to eventually generate a document for setting up the SEPA mandate.

However, I can't figure out how to do it.

Here's my XML view:


"1.0" encoding="utf-8"?>
<odoo>
    <template id="form_view" name="B2B Registration Form">
        <t t-call="website.layout">
            <form action="/submit-registration-form" method="post" class="registration_form">
                <img src="/b2b_registration/static/src/img/ellispe_black.png"
                    alt="Logo Ellispe Industries"
                    id="ellipse_logo" />
                <h1>Formulaire d'ouverture de compte B2Bh1>

                <t t-if="error_msg">
                    <div class="alert alert-danger">
                        <t t-esc="error_msg" />
                    div>
                t>

                <div>
                    <label class="required">Civilitélabel>
                    <select name="title">
                        <option value="3" selected="selected">Monsieuroption>
                        <option value="1">Madameoption>
                        <option value="2">Mademoiselleoption>
                    select>
                div>

                <div>
                    <label class="required">Représentantlabel>
                    <input type="text" name="fullname"
                        placeholder="ex: Pierre DUPONT" required="1" />
                div>

                <div>
                    <label class="required">Emaillabel>
                    <input type="email" name="email"
                        placeholder="" required="1" id="email-field" />
                div>

                <div>
                    <label class="required">Téléphonelabel>
                    <input type="tel" name="phone"
                        placeholder="" required="1" id="phone-field" />
                    <span>06 ou 07 pour recevoir les notifications de livraison par SMSspan>
                div>

                <br class="space" />

                <div>
                    <label class="required">Raison Socialelabel>
                    <input type="text" name="company_name"
                        placeholder="" required="1" />
                div>

                <div>
                    <label class="not-required">Site Weblabel>
                    <input type="text" name="website"
                        placeholder="" />
                div>

                <div>
                    <label class="required">SIRETlabel>
                    <input type="text" name="company_registry"
                        placeholder="" required="1" />
                div>

                <div>
                    <label class="required">N° de TVAlabel>
                    <input type="text" name="vat"
                        placeholder="" required="1" />
                div>

                <div>
                    <label class="required">Poste Occupélabel>
                    <input type="text" name="function"
                        placeholder="" required="1" />
                div>

                <div id="billing_address_fields">
                    <label class="required">Adresse de facturationlabel>
                    <input type="text" name="street"
                        placeholder="" />
                    <span>Rue *span>

                    <input type="text" name="street2"
                        placeholder="" />
                    <span>Rue 2span>

                    <input type="text" name="zip"
                        placeholder="" />
                    <span>Code Postal *span>

                    <input type="text" name="city"
                        placeholder="" />
                    <span>Ville *span>

                    <select name="country_id">
                        <option value="75" selected="selected">Franceoption>
                    select>
                    <span>Pays *span>
                div>

                <div class="row">
                    <input type="checkbox" id="same_address" name="same_address" value="yes" />
                    <label for="same_address">L'adresse de facturation est différente de l'adresse
                        de
                        livraisonlabel>
                div>

                <div id="delivery_address_fields">
                    <label class="required">Adresse de livraisonlabel>
                    <input type="text" name="shipping_street"
                        placeholder="" />
                    <span>Rue *span>

                    <input type="text" name="shipping_street2"
                        placeholder="" />
                    <span>Rue 2span>

                    <input type="text" name="shipping_zip" placeholder=""
                    />
                    <span>Code Postal *span>

                    <input type="text" name="shipping_city" placeholder=""
                    />
                    <span>Ville *span>

                    <select name="shipping_country_id">
                        <option value="75" selected="selected">Franceoption>
                    select>
                    <span>Pays *span>
                div>

                <div class="row" id="sepa_auth_row">
                    <input type="checkbox" id="sepa_auth" name="sepa_auth" value="yes"
                        checked="True" />
                    <label for="sepa_auth">J'autorise Ellipse à mettre en place le prélèvement
                        automatiquelabel>
                div>
                <div id="bank_fields">
                    <label class="required">Informations bancaireslabel>
                    <input type="text" name="iban_number"
                        placeholder="" />
                    <span>IBAN *span>

                    <input type="text" name="bic_number"
                        placeholder="" />
                    <span>BIC *span>

                    <input type="text" name="bank_name"
                        placeholder="" />
                    <span>Nom de la banque *span>
                div>

                <div class="row">
                    <input type="checkbox" id="cgv_checkbox" name="cgv_checkbox" value="yes"
                        required="1" />
                    <label for="cgv_checkbox">J'accepte les <a
                            href="https://drive.google.com/file/d/1hSY4IA0IwKyoVagGN_Ro_NUrjx9naT1u/view?usp=sharing"
                            target="_blank" id="cgv-link">Conditions
                            Générales de Ventea> d'Ellipse Industries *label>
                div>

                

                <input id="submit-btn" type="submit" value="Soumettre" />
            form>
        t>
    template>
odoo>

If you need more information, don't hesitate to contact us.

Thank you very much.

Avatar
Discard
Author

Yes I did. When I am adding the following field just before my submit input for example, nothing is happening. 

field name="signature" widget="signature"

Best Answer
  • Add a signature field in my XML view with Odoo 16 and custom modules
    In odoo backend, pass widget="signature" to binary field of signature in xml file.
    for an example,

    https://drive.google.com/file/d/123Erl2Mr2pbOc1yfQaedy3hWOq_D0KyB/view?usp=sharing


    And in odoo front-end you can use directly pre defined div for signature.
    For an example,


    https://drive.google.com/file/d/1sgHkoh7vEoZQ0HtHjPp4faIsN6uWuFT3/view?usp=sharing
Avatar
Discard
Best Answer

Hi,

In odoo backend, the signature is recorded using a widget called widget="signature". It is basically a Binary field which stores it as binary data. One way you can do it on the website is to upload your signature using file input and write that to the backend field on submitting the field.

Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
2
Apr 16
17565
6
Sep 17
7400
0
Apr 17
4521
3
May 16
7020
1
Mar 15
3843