# Keep preferred carrier service for a party

**URL:** https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287
**Category:** Ideas
**Created:** [April 2, 2019, 3:58pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287 "2019-04-02T15:58:31Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [April 2, 2019, 3:58pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/1 "2019-04-02T15:58:31Z")

</div>

## Rational

Each client can express a preference for a carrier service that would be selected as default in a sale. This module would give a way to store their choice.

## Proposal

Could be a module named sale\_shipment\_cost\_party that adds a field “carrier” on party, chosen among available\_carriers (like in module sale\_shipment\_cost).  
The Sale.on\_change\_party() from sale\_shipment\_cost would be modified to select the carrier from Party instead of the first available.

## Implementation

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [April 2, 2019, 4:10pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/2 "2019-04-02T16:10:47Z")

</div>

We should consider whether it is the carrier of the party of the carrier of the shipment\_party the one that should be used.

---

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [April 2, 2019, 4:46pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/3 "2019-04-02T16:46:37Z")

</div>

Sure if there’s a shipment\_party defined on sale and a preferred carrier for the shipment\_party, we should select it ; then teh preferred carrier of the sale’s party, and by default the first available carrier (as now).

Do you think its worth a new module or should it be a feature added to sale\_shipment\_cost?

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [April 2, 2019, 9:38pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/4 "2019-04-02T21:38:24Z")

</div>

For me, it makes sense to put in the existing module.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [April 3, 2019, 9:13am UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/5 "2019-04-03T09:13:22Z")

</div>

> [@jcm](#):
>
> Do you think its worth a new module or should it be a feature added to sale\_shipment\_cost?

I do not think the proposal is mature enough. It does not propose a good behavior which works with the carrier selection.  
Carrier are not always available for many reasons (work days, holidays, delivery address etc.).

---

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [April 6, 2019, 9:53pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/6 "2019-04-06T21:53:07Z")

</div>

> ced:  
> I do not think the proposal is mature enough. It does not propose a good behavior which works with the carrier selection.

Indeed, if the Carrier Selection is changed, the prefered carrier on the Party could become invalid. Though with the design proposed, everything would work as now: the first available carrier would be selected in the Sale, hence the Party’s carrier would be ignored.

We could simply store the last carrier used for each Party (better, to each Party shipment address), to reuse it the next time if it’s still in the available carriers.

But I don’t undestand the point with the work days or holidays. If a Party prefers a Carrier service for delevering its purchases, I suppose it knows the limits and restrictions of this service.

The need to store Party’s prefered carrier is a real business case I encounter here: since the shipment cost is invoiced, the client wants to choose the carrier service for its orders. It’s not simple (and error prone) to maintain an offline (ie off-tryton) list of prefered carrier service for each party…

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [April 7, 2019, 5:42pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/7 "2019-04-07T17:42:24Z")

</div>

> [@jcm](#):
>
> The need to store Party’s prefered carrier is a real business case I encounter here

Indeed I do not think it is a real business case.  
For me, we can divide the sale orders into two kinds:

- Filled by customerw (usually via web shop)
- Filled by salesmen (on a store, by phone call etc.)

The first case (by customers) does not need to store a preferred carrier because the customer will choose and confirm the selection.

In the second case (by salesmen), the salesman will have to ask or confirm the carrier out of the available (if there are more than one option).

So for me, there is no need to store an the party nor on the address a preferred carrier. But the default selection of the first one is probably the best behavior. I think the behavior could be improved like we did for the currency on purchase. We could pick the most used carrier by the customer out of the available ones. For me, it is a better behavior because it improves and help the user without requesting from him more actions. But also it makes the system a little bit _smart_ as if the customer starts to request a new carrier, after sometimes the system will propose this new one automatically.

---

<div class="post-metadata">

### Author: ![jcm](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/jcm/32/344_2.png) [@jcm](https://discuss.tryton.org/u/jcm)
#### Post date: [April 7, 2019, 6:10pm UTC](https://discuss.tryton.org/t/keep-preferred-carrier-service-for-a-party/1287/8 "2019-04-07T18:10:15Z")

</div>

> [@ced](#):
>
> Indeed I do not think it is a real business case […] In the second case (by salesmen), the salesman will have to ask or confirm the carrier out of the available (if there are more than one option).

Sorry to be a contradictor: in my business use case (publisher and book distributor), orders come by email (from bookstores) with mostly the mention “same carrier as usual”. Once we asked the buyer what carrier they prefer (by email or phone), we do not ask again and we have to maintain our own list of preferred carriers. This is rather time costly: having a better default carrier selected would shorten the time to process an order.

> [@ced](#):
>
> So for me, there is no need to store an the party nor on the address a preferred carrier. But the default selection of the first one is probably the best behavior. I think the behavior could be improved like we did for the currency on purchase. We could pick the most used carrier by the customer out of the available ones. For me, it is a better behavior because it improves and help the user without requesting from him more actions. But also it makes the system a little bit _smart_ as if the customer starts to request a new carrier, after sometimes the system will propose this new one automatically.

I agree such a behaviour would be a good enhancement. Maybe we could limit the computation of the _most used_ on a recent period for the customer (last 5 orders or all orders in the last 6 months for instance) so as a change for an old customer will be quickly visible.
