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

Set Mandatory field for creating a customer

By
Robert Klüsener
on 5/21/13, 9:05 AM 4,629 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?

3

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
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 (SA)
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 (SA)
on 5/23/13, 1:42 AM
0
can berk
On 8/27/14, 10:07 AM

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

0

Keyur

--Keyur--
1165
| 4 4 8
Ahmedabad, India
--Keyur--

Odoo Expert

Keyur
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.

Keyur
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

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: 5/21/13, 9:05 AM
Seen: 4629 times
Last updated: 3/16/15, 8:10 AM