# Sale Opportunity Contact Blueprint

**URL:** <https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270>\
**Category:** Feature\
**Tags:** sales\
**Created:** [December 22, 2016, 5:35pm UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270 "2016-12-22T17:35:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)\
**Post date:** [December 22, 2016, 5:35pm UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/1 "2016-12-22T17:35:20Z")

</div>

# Rational

Often when managing a sale opportunity the company is confronted to multiple stakeholders with multiple roles in the sale process.

# Proposal

### Models

- sale.opportunity.role
  - name

- sale.opportunity.contact
  - opportunity
  - party
  - role

- sale.opportunity
  - contacts: The One2Many to the `sale.opportunity.contact`

# Implementation

The ordering of the party when filling the contact O2M should take into account the relationship between the parties. The context and ordering used when searching for the parties should be defined using the new `search_*` keywords from [issue6081](https://bugs.tryton.org/issue6081)

Apart from those points the implementation should be pretty straightforward.

---

<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:** [December 22, 2016, 5:40pm UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/2 "2016-12-22T17:40:52Z")

</div>

Should not we also have the same but for employee? Often at different steps of the sale process, it is different employee who is in charge. Do we want to predefine or log them?

---

<div class="post-metadata">

**Author:** ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)\
**Post date:** [December 22, 2016, 5:43pm UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/3 "2016-12-22T17:43:10Z")

</div>

The design would be almost the same but I guess that we want to have a function field pointing to the current employee responsible for the opportunity (for search or notifications purposes).

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [December 23, 2016, 8:49am UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/4 "2016-12-23T08:49:39Z")

</div>

> [@nicoe](#):
>
> The design would be almost the same but I guess that we want to have a function field pointing to the current employee responsible for the opportunity

I agree with nicoe that we want to point to the current employee responsible, but instead of requiring a functional field I will prefier to have the real field and we should be able to know who was the responsible on the past thanks to the \_history feature.

This does not prevent to implement a rule mechanism to change the responsible employee based on triggered actions. And I think this is out of the scope of the current blueprint.

---

<div class="post-metadata">

**Author:** ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)\
**Post date:** [December 23, 2016, 8:58am UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/5 "2016-12-23T08:58:28Z")

</div>

Going back to the proposed blueprint.

For me this point is still not clear:

> [@nicoe](#):
>
> The ordering of the party when filling the contact O2M should take into account the relationship between the parties

Could you clarify which parties should be showed first?  
Is there any relation between the relationship type and the opportunity role?  
Should we allow to select only parties that are related to the customer?

Also I’m wondering if it will be good to have a notes field on the opportunity contact in order to track additional details about the relation.

---

<div class="post-metadata">

**Author:** ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)\
**Post date:** [December 23, 2016, 12:53pm UTC](https://discuss.tryton.org/t/sale-opportunity-contact-blueprint/270/6 "2016-12-23T12:53:15Z")

</div>

> [@pokoli](#):
>
> Could you clarify which parties should be showed first?

This is related to [issue5853](https://bugs.tryton.org/issue5853). The company would have to define herself the groups to have the sort of the parties that they want.

> [@pokoli](#):
>
> Is there any relation between the relationship type and the opportunity role?

I don’t think so, the relationship type is generic while the opportunity role might change from one opportunity to another.

> [@pokoli](#):
>
> Should we allow to select only parties that are related to the customer?

I don’t think so, the idea of sorting the party is to have to most relevant first but still allow to select any party.
