This question has been flagged
2 Replies
14045 Views

Odoo recognizes a contact as customer or supplier if his supplier_rank or customer_rank is > 0. By default, when creating a contact, the rank is = 0.

There are 4 ways the customer_rank or supplier_rank increases in V.13 and V.14:

1. Invoice/bill the contact. Each time the contact is invoiced, the customer_rank >> + 1, if he is billed, the supplier_rank>> + 1 

2. Create/import the contact via the sale/purchase app. The rank will be automatically set to 1. 

3. With an import in the contact app, force the status using the field supplier_rank = 1 if supplier and customer_rank = 1 if customer. 

4. You can also create a server action and add a contextual action
WARNING : IF YOU HAVE AN ODOO ENTERPRISE SUBSCRIPTION, THIS MAY TRIGGER MAINTENANCE COST

Go in debug mode and access server actions from settings > technical > actions. Create three server actions: one to set a contact as customer, one as supplier and the last one as customer and supplier.

Ex : 
"Set as Customer"
 Model = Res.partener "contact"
Action to do : "Update the record"
Field = "customer rank (res.partner)
Evaluation type = "value"
Value = "1".
Save
Add a contextual action.

Same procedure for suppliers and customer and supplier.

After creating them, go to contact > list view > select a few contact > hit the "action" menu > hit "set as customer". 

As a result, the contact you selected will be new considered as customer. 


 


Avatar
Discard
Best Answer

Hello everyone,

My answer is not late I hope?

Here is a module that may help: https://apps.odoo.com/apps/modules/14.0/cup_is_customer_is_vendor/

Cordial greetings

Avatar
Discard
Best Answer

A partner is a supplier when the value of the field supplier_rank is greater than 0 and a partner is a customer when the value of the field customer_rank is greater than 0

You can add a domain [('supplier_rank','>=',0)] for suppliers and  [('customer_rank','>=',0)]

Now if you want a partner to be supplier and customer then give supplier_rank and customer_rank a value greater than 0

Avatar
Discard