Odoo Help


Set Mandatory field for creating a customer

Robert Klüsener
on 5/21/13, 9:05 AM 8,147 views

How can I make the fields "Fiscal Position" and "Customer Payment Term" mandatory field for creating a new company that is marked as Customer?


Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 5/21/13, 9:29 AM

You can use attrs tag in xml.

For example:

<field name="property_payment_term" attrs="{'required': [('customer','=',True)]}"/>

This will make Customer Payment Term field mandatory when Customer is True.

Same thing you can apply for other fields also.

Thank you for the quick answer. In the developer mode I selected the Edit Form View option to see and edit the xml. But unfortunately I can not find the fields of the Accounting Tab. Do you know where I can find them in order to edit them?

Feuerwear GmbH & Co. KG, Robert Klüsener
on 5/21/13, 10:18 AM

You can find "Accounting" tab in account module.

Sudhir Arya (ERP Harbor Consulting Services)
on 5/21/13, 10:27 AM

I can not find this field. Maybe you can make a screenshoot to show me where to find it?

Feuerwear GmbH & Co. KG, Robert Klüsener
on 5/22/13, 7:33 PM

property_payment_term is on line: 86

Sudhir Arya (ERP Harbor Consulting Services)
on 5/23/13, 1:42 AM
On 11/12/17, 10:32 AM

Can you resolved this issue? I customize field pack in form product and when I create the product I have the problem

creation/update: a mandatory field is not correctly set
[object with reference: Product Template - product.template]

but, I already create product in product.template but still have warning this.

any ideas? can somebody answer me? thank you.



| 4 4 8
Ahmedabad, India

Odoo Expert

On 5/21/13, 9:29 AM

Hi Robert.

You can use attrs attribute to make mandatory field depending on the other field.

For e.g. attrs="{'required': [('customer', '=', True)]}"

image description

Hi Keyur, thank you for the quick answer! Unfortunately I can not find the fields of the Accounting Tab in the View Editor. do you know how to access the fields to change the attributes?

Feuerwear GmbH & Co. KG, Robert Klüsener
on 5/21/13, 9:59 AM

You can only see field of Accounting if the partner is a company. Check my updated answer.

on 5/21/13, 10:33 AM

I checked the "is a Comnpany" box and selected the Accounting Tab, but when I edit the re.partner form in the View Editor, I only see the fields of the Contacts Tab, the Internal Notes Tab, the Sales & Purchase Tab and the Warnings Tab. There are neither fields from the Payment Payment Follow-up nor from the Accounting Tab :-(

Feuerwear GmbH & Co. KG, Robert Klüsener
on 5/21/13, 11:03 AM
Teknopet A.Ş.
On 8/27/14, 10:07 AM

have you resolved this issue? I also have the same problem

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 5/21/13, 9:05 AM
Seen: 8147 times
Last updated: 11/12/17, 10:32 AM