# Duplicate variant

**URL:** https://discuss.tryton.org/t/duplicate-variant/5918
**Category:** User
**Created:** [February 10, 2023, 12:59pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918 "2023-02-10T12:59:29Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 10, 2023, 12:59pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/1 "2023-02-10T12:59:30Z")

</div>

I just noticed that when i create a new product template and then add i end up with duplicate of it.

This mean if i create a product name “mango”  
Then go to product template to add it and save,  
I then will have two mango showing on product template.

On product i have one but on variant i see two.

---

<div class="post-metadata">

### Author: ![udono](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/udono/32/2114_2.png) [@udono](https://discuss.tryton.org/u/udono)
#### Post date: [February 10, 2023, 1:52pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/2 "2023-02-10T13:52:48Z")

</div>

Hi, unfortunately I don’t understand the issue or question. When you create two variants with the same product (template), the product (template) has two product variants. HIH

---

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 10, 2023, 2:21pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/3 "2023-02-10T14:21:14Z")

</div>

When i create one product template i have two varient of the product. One product template = two variants

---

<div class="post-metadata">

### Author: ![udono](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/udono/32/2114_2.png) [@udono](https://discuss.tryton.org/u/udono)
#### Post date: [February 10, 2023, 2:37pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/4 "2023-02-10T14:37:24Z")

</div>

> [@adeseg99](#):
>
> One product template = two variants

I can’t reproduce. When I create a product (template) only one variant is created per default. See [https://demo6.6.tryton.org/#demo6.6/model/product.template/18;name=“Products”&views=[304%2C303]](https://demo6.6.tryton.org/#demo6.6/model/product.template/18;name=%22Products%22&views=%5B304%2C303%5D)  
Only when I also press on [+] button in the variants menu, I get two variants: the default one and the additional.  
So maybe you just need to fill the default variant on product template creation and save the product template.

---

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 10, 2023, 3:46pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/5 "2023-02-10T15:46:12Z")

</div>

Okay follow this step, create a new puchase then on puchase line create a new product from the line this should create two product template

---

<div class="post-metadata">

### Author: ![udono](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/udono/32/2114_2.png) [@udono](https://discuss.tryton.org/u/udono)
#### Post date: [February 10, 2023, 3:54pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/6 "2023-02-10T15:54:56Z")

</div>

Can’t reproduce. I did exactly as you say and it creates one template when I create a new template.  
See [https://demo6.6.tryton.org/#demo6.6/model/product.template/19;name=“Products”&views=[304%2C303]](https://demo6.6.tryton.org/#demo6.6/model/product.template/19;name=%22Products%22&views=%5B304%2C303%5D)

When I choose from the existing templates, it doesn’t create a new template, but connects the variant with the existing template (which maybe already has a variant).  
See [https://demo6.6.tryton.org/#demo6.6/model/product.template/18;name=“Products”&views=[304%2C303]](https://demo6.6.tryton.org/#demo6.6/model/product.template/18;name=%22Products%22&views=%5B304%2C303%5D)

---

<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 10, 2023, 4:02pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/7 "2023-02-10T16:02:01Z")

</div>

If you create a template from the product form, you will end up with 2 variants because the creation of a template create a variant by default. So you must delete the variant when creating the template in this case.

But this should no more happen since [Skip default products when template created from product (#9025) · Issues · Tryton / Tryton · GitLab](https://foss.heptapod.net/tryton/tryton/-/issues/9025).

---

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 10, 2023, 5:04pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/8 "2023-02-10T17:04:23Z")

</div>

Okay will look at it.

---

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 16, 2023, 6:56am UTC](https://discuss.tryton.org/t/duplicate-variant/5918/9 "2023-02-16T06:56:53Z")

</div>

What is the way to solve this or stop it from happening apart from stopping the use of product template to create product

---

<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 16, 2023, 8:15am UTC](https://discuss.tryton.org/t/duplicate-variant/5918/10 "2023-02-16T08:15:13Z")

</div>

Use a recent version of Tryton with the fix.

---

<div class="post-metadata">

### Author: ![adeseg99](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/a/977dab/32.png) [@adeseg99](https://discuss.tryton.org/u/adeseg99)
#### Post date: [February 16, 2023, 8:20am UTC](https://discuss.tryton.org/t/duplicate-variant/5918/11 "2023-02-16T08:20:10Z")

</div>

Cant i apply the fix the stress of updating my tryton backend and database is what i dont want to go through for now.

If i can get the fix lines and apply the patch

---

<div class="post-metadata">

### Author: ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)
#### Post date: [February 16, 2023, 3:06pm UTC](https://discuss.tryton.org/t/duplicate-variant/5918/12 "2023-02-16T15:06:31Z")

</div>

> [@adeseg99](#):
>
> If i can get the fix lines and apply the patch

See [https://codereview.tryton.org/253011005/](https://codereview.tryton.org/253011005/) but be aware that when doing an update your changes are lost.
