# Manage customer product in B2B

**URL:** https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096
**Category:** Feature
**Created:** [February 1, 2019, 2:39pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096 "2019-02-01T14:39:55Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [February 1, 2019, 2:39pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/1 "2019-02-01T14:39:55Z")

</div>

## Rational

In B2B sales workflow, we need to provide to customers their own product code and name on the reports (invoice, packing,…)

## Proposal

Adding to tryton the management of customer product code and name at the template or variant level.  
We should allowed to have many customer code on one product code (many2one).

## Implementation

We define 2 new one2many fields “product\_customers” : one for the template and another one for the variant. Those fields are sequence\_ordered, first item will be used as default value.  
We add both fields on the customer tab of the product form.  
We add a many2one field on the sale line to select the product customer code (with as default value the first customer product code found)

> **[RFC : Sale Product Customer (#8133) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/8133)**
>
> Following discussion: https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096

---

<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: [February 1, 2019, 3:01pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/2 "2019-02-01T15:01:16Z")

</div>

I think this could be a good addition (we already implemented something similar: [https://bitbucket.org/nantic/trytond-sale\_customer\_product](https://bitbucket.org/nantic/trytond-sale_customer_product)).

I have some doubts:

- Having 2 one2many’s is strange. I admit we have the same problem with supplier information nowadays and I don’t have a good solution for it
- I don’t understand the need for a sequence in those one2many fields

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [February 1, 2019, 3:02pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/3 "2019-02-01T15:02:02Z")

</div>

> [@maxx](#):
>
> In B2B sales workflow, we need to provide to customers their own product code and name on the reports (invoice, packing,…)

FYI, we implemented it in [product\_cross\_reference](https://bitbucket.org/datalife_sco/trytond-product_cross_reference) 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: [February 1, 2019, 3:25pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/4 "2019-02-01T15:25:47Z")

</div>

> [@albert](#):
>
> Having 2 one2many’s is strange. I admit we have the same problem with supplier information nowadays and I don’t have a good solution for it

The proposal is based on [suppliers don't relate to product variants (#6799) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue6799) for supplier.

> [@albert](#):
>
> I don’t understand the need for a sequence in those one2many fields

This is because we do not want to add a unique constraint per party, so it is good to have a way to choose a default.

---

<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: [February 4, 2019, 3:07pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/5 "2019-02-04T15:07:27Z")

</div>

> [@ced](#):
>
> The proposal is based on [Issue 6799: suppliers don’t relate to product variants - Tryton issue tracker](https://bugs.tryton.org/issue6799) for supplier.

So I think why not following the same pattern and relate customer codes to templates and leaving the variant for customization?

---

<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: [February 4, 2019, 6:40pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/6 "2019-02-04T18:40:07Z")

</div>

> [@pokoli](#):
>
> So I think why not following the same pattern and relate customer codes to templates and leaving the variant for customization?

Because I think the current pattern for product supplier is not good enough by default and customize it properly is complex.

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [February 20, 2019, 9:06am UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/7 "2019-02-20T09:06:44Z")

</div>

I’ve submitted [RFC : Sale Product Customer (#8133) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue8133)

---

<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 15, 2019, 4:00pm UTC](https://discuss.tryton.org/t/manage-customer-product-in-b2b/1096/8 "2019-04-15T16:00:04Z")

</div>

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