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

zip code and city obligatory

By
Laurent33
on 4/12/13, 1:49 PM 1,290 views

Hi, i work on Openerp7.

i want to make zip code and city obligatory on res.partner.form in a custom module.

I've tried to inherit XLM view and put this fields as required. It seems ok but according the country of the company, class format_address() in base.res_partner.py modify the view and then zip code and city are no longer required even if i inherit format_adress() class and put in code for example :

<field name="zip" required="1" placeholder="ZIP mandatory" />

required="1" seems don't work...

How can I do ?

0

Ray Carnes

--Ray Carnes--
15687
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 4/12/13, 4:43 PM

I was able to get this field to be mandatory by just inheriting and changing the attribute 'required':

image description

This results in the field becoming mandatory on the form view:

image description

As I say in my question :It seems ok but according the country of the company, class format_address() in base.res_partner.py modify the view and then zip code and city are no longer required even if i inherit format_adress() class and put in code for example : <field name="zip" required="1" placeholder="ZIP mandatory" />

required="1" seems don't work...

How can I do ?

Laurent33
on 5/3/13, 11:06 AM

Sorry. I didn't check my option with different countries.

Bista Solutions US, Ray Carnes
on 5/3/13, 6:14 PM

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: 4/12/13, 1:49 PM
Seen: 1290 times
Last updated: 3/16/15, 8:10 AM