Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
1100 Visualizzazioni

We are company that's very sales-focused and consistently need to manage our recurring customers. It can prove immensely valuable to monitor whether a recurring contact has made any purchases in the recent month, for instance. This functionality provides us with a convenient list of contacts to reach out to in order to rekindle sales interactions. Presently, in Odoo, you can access a list of Sales Orders associated with a contact by navigating to the contact's profile and selecting the Sales Orders stat button. However, when dealing with a large volume of contacts, this process can become labor-intensive. 

Is there a straightforward method for filtering out contacts that have not generated a Sales Order within a specified period, such as the past month.


Avatar
Abbandona
Autore Risposta migliore

Yes, it is possible with studio and related fields, as long as the relations are setup correctly. To understand the logic behind this, we must understand that the Contacts model is linked to the Sales model out-of-the-box. This is why we can see all the Sales Orders on the Contact form in the stat buttons. Once you establish a connection between 2 models, you can pull information from one to the other through Related Fields, as long as the path is correct. Following are step-by-step instructions on how to establish this. 

  1. Make sure you are in Debug (developer) mode. Open Studio while in the Contacts form view.
  2. Drag and drop a new DateTime field anywhere on the form view. By default, this is a brand-new field and is not related to anything.
  3. Name this field “Latest Sales Order Date” or anything along those lines. This will be the field that will display the last order date once we configure it.
  4. Click on the new field and click the “More” option on the bottom left toolbar.
  5. This will open field properties. Under “Related Field” input this – “sale_order_ids.date_order”. To explain what this means - we are relating it to the Order Date (date_order) field on the Sales Order link in contacts (sale_order_ids).
  6. Close Studio and refresh your page.

You have now created a DateTime field which is linked to the Order Date field in Sales Orders. Since Sales Orders are sorted by default by Order Date, it will always pull the latest order date. You can now Filter and Groupby this new field and setting a Filter that displays contacts with latest order date before a particular date will give you a list of contacts that haven’t purchased from you in a while.

Limitations-

  • If you have custom sorting on your Sales Orders, this will not work. It always pulls the date of the first Sale Order it finds, so it is imperative that we have the latest Sale Order first. The sorting needs to be by Order Date.
  • This new field will NOT auto-populate all the contacts for existing Sales Orders. In other words, it is not retrospective. It will only start populating the Dates for new Sales Orders created moving forward. This is an important point to note, as it will be blank after you follow the above steps. But when you create the next Sale Order, it will populate. Over time, it will self-correct to populate values for your contacts.

 

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
ago 24
549
1
ago 24
765
1
ago 24
648
1
ott 24
853
1
mar 25
435