Odoo Help

2

0
1 Answer
1
Avatar

Sudhir Arya (ERP Harbor Consulting Services) India

--Sudhir Arya (ERP Harbor Consulting Services)--
26852
| 8 9 10
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 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) India
10/1/19, 1:51 AM

Your related field is a M2o field and you cannot use string value in the domain for relational field. You should create a related field of the type field of user_type_id.

Try this:

type_account = fields.Selection([
('other', 'Regular'),
('receivable', 'Receivable'),
('payable', 'Payable'),
('liquidity', 'Liquidity'),
], string='Type', related=account_id.user_type_id.type)

This will give you the type of the account like: receivable, payable, etc related to the selected account

4 Comments
rehmanabdullah355@gmail.com Pakistan
10/1/19, 1:54 AM

Thanks for replying ! if you make it a Char field it says

"TypeError: Type of related field account.move.line.type_account is inconsistent with account.account.user_type_id

"

This error as you know means that relational field must be of the same type to which you are relating it too

Sudhir Arya (ERP Harbor Consulting Services) India
10/1/19, 2:09 AM

See my updated answer. Lets make the field selection type.

rehmanabdullah355@gmail.com Pakistan
10/1/19, 2:39 AM

Thank You so much man. It worked and following attrs works with it

attrs="{'required':[('user_type','=','payable')]}"

Sudhir Arya (ERP Harbor Consulting Services) India
10/1/19, 2:48 AM

Cool.

Ask a Question
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 E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now