Odoo Help

0

0
4 Answers
3
Avatar

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
4327
| 6 6 10
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
24/4/15 06:52

In a many2one field, you could restrict the records shown by using domain in Odoo.

<field name="partner_id" domain="[('customer','=',True)]" > 

A similar case has been handled in Sales order, you could check the code in sale module.

https://github.com/odoo/odoo/blob/8.0/addons/sale/sale_view.xml#L10   

2
Avatar

Bejaoui Souheil

--Bejaoui Souheil--
1131
| 2 1 7
Waterloo, Belgium
--Bejaoui Souheil--

Odoo developer,  functional and technical consultant

souheil_bejaoui@hotmail.fr

Bejaoui Souheil
24/4/15 05:57

Hi,

The filed name to check with is "customer" not "customers"


0
Avatar

Dhinesh

--Dhinesh--
3915
| 6 5 11
Pondicherry, India
--Dhinesh--

Passionate coder in Python/OpenERP. Knows Django/Flask MVC frameworks.

 

Dhinesh
27/4/15 03:18

First enable debug mode. Go to -> Sale -> Customers -> Sale & Purchase tab -> Customer. Find the technical name of customer field. Your field name in domain is wrong. You will not get any error due to the wrong name in the domain.

Technically the domain will be applied with a wrong name in it for the particular field "res_partner_id". You can view the applied domain in debug mode.


domain = "[("customer", "=", True)]" 
0
Siobhan
24/4/15 06:24

Hello 

Thank you for your help.. I was using " instead of ' in the domain syntax


Ask a Question
Writer
Keep Informed
1 follower(s)
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.

Register
Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now