Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Custom Forms In Website Builder

Subscribe

Get notified when there's activity on this post

This question has been flagged
formcustomizationwebsite_crm
2 Replies
11319 Views
Avatar
Anthony Gardiner

I've spent many an hour trying to resolve this issue, your help shall be appreciated.

I followed this post https://www.odoo.com/forum/help-1/question/how-to-do-custom-forms-in-v8-website-62623

You can find my portal at http://119.9.27.63:8069/page/website.contactus it has been customized to have more fields, named as per crm.leads forms

I want to remove the "Mandatory Comments" 

I cannot find where the code or fields are demanding this field to be completed.

It becomes a secondary problem in that I have a second form with minimal fields being shown, yet because the comments is mandatory it stops the second form working again that link is here http://119.9.27.63:8069/page/website-referral

 <?xml version="1.0"?>
<data name="Contact Form" inherit_id="website.contactus" customize_show="False">
    <xpath expr="//div[@name='mail_button']" position="replace">
        <form action="/crm/contactus" method="post" class="form-horizontal mt32" enctype="multipart/form-data">
            <div t-attf-class="form-group #{error and 'contact_name' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="contact_name">Contact</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="contact_name" required="False" t-attf-value="#{contact_name or ''}"/>
                </div>
			</div>
            <div name="email_from_container" t-attf-class="form-group #{error and 'email_from' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="email_from">Email</label>
                <div class="col-md-7 col-sm-8">
                    <input type="email" class="form-control" name="email_from" required="False" t-attf-value="#{email_from or ''}"/>
                </div>	
            </div>
            <div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="phone">Phone Number</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="phone" placeholder="" t-attf-value="#{phone or ''}"/>
                </div>
				</div>
            <div t-attf-class="form-group #{error and 'phone' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="mobile">Mobile</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="mobile" placeholder="" t-attf-value="#{phone or ''}"/>
                </div>
			</div>
            <div t-attf-class="form-group #{error and 'name' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="name">Street</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="name" t-attf-value="#{name or ''}"/>
                </div>
			</div>
			
						<div t-attf-class="form-group #{error and 'name' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="city">Suburb</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="city" t-attf-value="#{name or ''}"/>
                </div>
			</div>

            <div t-attf-class="form-group #{error and 'name' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="zip">Postcode</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="zip" t-attf-value="#{name or ''}"/>
                </div>	
            </div>
                
            <div t-attf-class="form-group #{error and 'name' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="referred">Referral Email</label>
                <div class="col-md-7 col-sm-8">
                    <input type="text" class="form-control" name="referred" t-attf-value="#{name or ''}"/>
                </div> 
	    </div>
                		 <div t-attf-class="form-group #{error and 'description' in error and 'has-error' or ''}">
                <label class="col-md-3 col-sm-4 control-label" for="description">Comments</label>
                <div class="col-md-7 col-sm-8">
                    <textarea class="form-control" name="description" style="min-height: 120px"><t t-attf-value="#{name or ''}"/></textarea>
                </div>    
            </div>
            <div class="form-group">
                <div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
                    <button class="btn btn-primary btn-lg">Send</button>
                </div>
            </div>
        </form>
    </xpath>
</data>
1
Avatar
Discard
Avatar
Jérémy Kersten (jke)
Best Answer

Hello


The required field is setted in python code directly: 

@http.route(['/crm/contactus'], type='http', auth="public", website=True)
def contactus(self, **kwargs):
_TECHNICAL = ['show_info', 'view_from', 'view_callback']
_BLACKLIST = ['id', 'create_uid', 'create_date', 'write_uid', 'write_date', 'user_id', 'active']
_REQUIRED = ['name', 'contact_name', 'email_from', 'description']


so if you don't want description file in your form, add this input with a type='hidden' and a default value like a . or nbsp.

0
Avatar
Discard
Avatar
michel Guénard
Best Answer

The various pages of the web site are accessible through the "backend".

Configuration>>technical>> user >> views.

There make a seach for "web". You should be able to find out the pages of interest for your issue.

Having said that, It might be also that some parts are coded into the python lines, somewhere else.

For instance I have not yet find out some comments appearing on my web pages thatI would be willing to eliminate.

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Odoo10 Custom Form Doesn't Save
form customization odoov10
Avatar
0
May 19
4214
How to set default value of website form field?
form defaults website_crm
Avatar
Avatar
Avatar
Avatar
3
Sep 17
12322
Select input not working in contact form Solved
form contacts selection customization
Avatar
Avatar
1
Sep 21
4465
How send/get multiple checkboxes with the same name from website form to odoo Solved
form controller checkbox website_crm
Avatar
Avatar
5
Jan 24
14584
How to solve Parse Error: Error While Validating the Constraint; Field does not exist
form customer customization odoo10
Avatar
Avatar
Avatar
Avatar
3
Mar 18
24693
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now