Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

how to create registration form in website?

By
aneesh ATEES Infomedia Pvt Ltd
on 2/11/15, 1:40 AM 915 views

how to create registration form in website?also i want ti enter the details in the database

1

Vasanth

--Vasanth--
3458
| 5 3 8
Pondicherry, India
--Vasanth--
Vasanth
On 2/11/15, 2:39 AM

Hi, 

After some experimenting I managed to set up custom forms through the front-end of Odoo in v8 website builder.

The short version: create a new page from website_builder and copy the HTML sources of contactus and contact_form together into your new page. Remove the kwargs div and start configuring to your liking.

...and these are the step-by-step instructions and some tips and tricks at the bottom:

  1. Create a new page from the frontend (Content - New Page)
  2. Open the 'Contact Us' form and go to Customize - HTML Editor
  3. Copy the <div id="wrap">....</div> and its entire content (i.e. the entire page minus the <t> tags)
  4. Go back to your 'new page', customize - HTML editor and delete everything between its <t> tags
  5. Paste your form code between the <t> tags instead.
  6. Go back to your 'Contact Us' form, customize - HTML editor.
  7. From the dropdown select the file ' - Contact Form' (it should now say "Template ID: website_crm.contactus_form" at the top)
  8. Copy the entire <form ....>...</form> tag incl its content
  9. Back to the 'new page', customize - HTML Editor
  10. Now replace the <div ... name="mail_button" > and its entire contenct with the <form> tag and its content by hitting paste (from point 8).
  11. Now comment out or delete the section (IMPORTANT)
    <t t-foreach="kwargs" t-as="kwarg">
         <input type="hidden" t-att-name="kwarg[0]" t-att-value="kwarg[1]"/>
    </t>
  12. This is essentially it. Now you have a functioning copy of the contact form and you can start to modify it as nicely demonstrated here  https://www.youtube.com/watch?v=lKnkyh0ctUI

Tips & Tricks:

You can use any of the field names in the Sales Lead Form to directly insert values into the desired fields from your form. For instance I wanted to make sure that each 'Lead' from this form is marked as coming through a separate channel. To do this I added a new Channel "Custom Form Submission" (which in my case got Channel ID in the db). Channels are e.g. accessible from the Sales Lead form under Extra Info - Marketing. Then by adding a hidden field to the form's form-group, each form submission creates a lead which will have the right channel associated with it.

The code for the hidden field is below. Make sure to adjust the t-attf-value (i.e. the channel id) according to your setup:

<div t-attf-class="form-group">
     <div class="col-md-7 col-sm-8">
         <input type="hidden" class="form-control" name="medium_id" t-attf-value="6"/>
     </div>
</div>

This should work with all your fields if you get the fieldname and the data type right.

Hope this helps everyone.

Regards
Frank

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 2/11/15, 1:40 AM
Seen: 915 times
Last updated: 3/16/15, 8:10 AM