Skip to Content
Menu
This question has been flagged
2 Replies
2064 Views

I have a many2one field to 'res.partner' it's preferred vendor field , it showing both vendors and customers, and when I create partner from this field not listing in vendor list . how can I manage it ?

Avatar
Discard
Best Answer

Hi,
You can simply add domain in many2one field ,
Like

<field name="may2one" domain="[('supplier_rank', '=', True)]" context="{'default_supplier_rank': 1}"/>

It'll display vendors only , and if you create vendor from many2one field the partner will display in your vendor list .

Regards

Avatar
Discard

For customers use customer_rank instead of supplier_rank

Best Answer

Hi Sergio:

Odoo 13 has done away with tagging a partner as a customer and a vendor using a boolean field. It has introduced the concept of a customer rank and a supplier rank which is maintained dynamically based on sales and purchases processed in the system. A partner with a customer_rank > 0 is treated as a customer and a partner with a supplier_rank > 0 is treated as a vendor. A partner could be both if both ranks are > 0.

You can find more information in the following thread: 

https://www.odoo.com/forum/help-1/question/customer-supplier-odoo-13-157583

Avatar
Discard