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.

0

Prefix(www) Validation for website textfield

By
Jothimani
on 3/29/14, 4:02 AM 1,385 views

Hi i want to validate a field prefix, when i enter a website in a field like (jothimani.com), here i want show error (Please enter valid Website address ex: www.jothimani.com here is my code...

in xml

<record id="view_employee_form" model="ir.ui.view">
    <field name="name">jebatraining.form_view</field>
    <field name="model">employee_data</field>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <form string="Employee Details">
            <field name="website" string="Website"/>
        </form>
    </field>
 </record>

in py

class jebatraining(osv.osv):
    _name = "employee_data"
    _description = "Employee management"
    _columns = {
        'website':fields.char('Website', size=50, required=True),

        }
jebatraining()

hi anyone help me to know what can i do here?

0

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 3/29/14, 4:11 AM

Hi

Try this code

<record id="view_employee_form" model="ir.ui.view">
<field name="name">jebatraining.form_view</field>
<field name="model">employee_data</field>
<field name="type">form</field>
<field name="arch" type="xml">
    <form string="Employee Details">
        <field name="website" widget="url" string="Website"/>
    </form>
</field>

</record>

its working dude............!!!!!!!!! thanks!!!!!!!!

Jothimani
on 3/29/14, 4:34 AM

Enjoy ........

Jagdish Panchal
on 3/29/14, 4:37 AM

k i'll enjoy now

Jothimani
on 3/29/14, 4:55 AM

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

0 follower(s)

Stats

Asked: 3/29/14, 4:02 AM
Seen: 1385 times
Last updated: 3/16/15, 8:10 AM