top of page
Search
  • Chris Tringham

Using Server Actions to set a contact to be a customer or supplier

Updated: Nov 25, 2019

 

In Odoo 13, the fields "Is a Customer" and "Is a Supplier" on a contact have been removed.


Instead there are two new fields for Customer Rank and Supplier Rank but they are not displayed, and so cannot be changed.


If you create a contact from the Customer menu option it will have Customer Rank set to 1, and can then be selected as a customer on a Quotation / Sales Order. Similar logic applies for suppliers / vendors.


If you want to have a contact who is both a customer and a supplier, you can create a Server Action to set Customer Rank (or Supplier Rank, or both, to 1.


You need to be in debug mode. Then navigate to Settings / Technical / Server Actions


Click on "Create"

Now enter an action name ("Set as Customer"), model (Contact / res.partner), field (Customer Rank), and Value (1) and then press "SAVE"



The next step is to create a Contextual Action by clicking on "CREATE CONTEXTUAL ACTION"





And this will be available from the "Action" dropdown:



It's simple to make this server action update a contact to be both a customer and supplier:


127 views0 comments

Recent Posts

See All

Server Actions to copy (and delete)

There's a newer version of this post here: https://odootricks.tips/server-actions-copy-delete/ An interesting use of Server Actions to copy (and delete) multiple records. This is another one from Jake

Automated Action to create a BOM

There's a newer version of this post here: https://odootricks.tips/about/automated-action-to-create-a-bom/ This is a great example of the power of Automated Actions to do something useful. Credit to J

Create Reordering Rules by using Automated Actions

There's a newer version of this post here: https://odootricks.tips/automated-actions-reordering-rules/ The requirement is to automatically create Reordering Rules when you create a product. You need t

bottom of page