# Support more than 1 carrier

**URL:** https://discuss.tryton.org/t/support-more-than-1-carrier/5441
**Category:** Feature
**Created:** [July 28, 2022, 12:52pm UTC](https://discuss.tryton.org/t/support-more-than-1-carrier/5441 "2022-07-28T12:52:10Z")
**Posts on this page:** 2
**Page:** 1

<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: [July 28, 2022, 12:52pm UTC](https://discuss.tryton.org/t/support-more-than-1-carrier/5441/1 "2022-07-28T12:52:11Z")

</div>

Continuing the discussion from [Managing incoterms on tryton](https://discuss.tryton.org/t/managing-incoterms-on-tryton/1756/57):

## Rational

In some case the delivery must be managed by many carriers. Ex: a first carrier to move shipment from the company warehouse to a port, a main carrier for the boat and another carrier from the destination port to the customer warehouse.

## Proposal

We add a generic Model `carrier.carriage` to store carriers for sale and shipments. It includes:

- document: `Reference`
- type: `Selection`: `before`, `after`
- sequence: `Integer`
- carrier: `Many2One` to `carrier`
- shipment\_cost\_method: `Selection`
- from/to address: `Many2One` to `party.address` (used to compute selection)

On sale, we add:

- before\_carriages: `One2Many` to `carrier.carriage` (using a filter domain).
- after\_carriages: `One2Many` to `carrier.carriage` (using a filter domain), only allowed if carrier is filled.
- carrier\_from/to\_address: `Many2One` to `party.address` used to compute from/to\_country if before/after\_carriers is filled.

The before/after\_carriers are copied to the shipments.

On shipments (in, out and out return), we add:

- before/after\_carriage: `One2Many` to `carrier.carriage` (using a filter domain).

The compute cost methods are extended to add the cost (or sale cost) of the list of carriers.

The Incoterms are extended to add:

- before\_carriages: `Selection` like `carrier`
- after\_carriages: `Selection` like `carrier`

Incotern pattern is filled:

- before\_carriage is:
  - seller if before\_carriages is filled with at least one shipment cost method or not filled with a shipment cost method
  - buyer if before\_carriages is filled with no shipment cost method and not filled with no shipment cost method

- after\_carrier is:
  - seller if after\_carriages is filled with at least one shipment cost method
  - buyer if after\_carriages is filled with any shipment cost method

## Implementation

- [Use ShipmentCostMixin for supplier shipment (#11617) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue11617)
- [Use cost method from shipment instead of sale (#11620) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue11620)
- [Add carrier\_carriage module (#11623) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue11623)

---

<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: [September 19, 2022, 6:00am UTC](https://discuss.tryton.org/t/support-more-than-1-carrier/5441/2 "2022-09-19T06:00:41Z")

</div>

This topic was automatically closed after 8 days. New replies are no longer allowed.
