Choosing between a product template or a variant

Because I am uncertain of where a variant should be used I created all my base products as individual templates with one variant each, safer like this.

Now I am creating a new product which many people should be familiar with:

EPAL 1, Class A, cost_price = 20 RON
EPAL 1, Class B, cost_price = 15 RON
EPAL 1, Class C, cost_price = 10 RON

All these products will be sold at cost price.

Should they be created as template+variant, or as one template+3 variants?

Do I need to extend product.product in order to have a different sale price for each variant as suggested in price-on-product

Should I use the product_price_list in order to solve this by using the formula, even though the price for the pallets is the same for everyone?

There is no all cases solution on this question.
But if you are using the product attribute module to store the class you should use 3 variants with the same attribute set.

This can be achieved by using cost_price expression in the price_list of this products. Otherwise tryton will always use the list_price, which by default is the one of the list price.

If you plan to use the cost price of the variant I do not think it this right way to go.

Indeed if you do not want to use the product_price_list module you can override the template to include a flag that indicates that the sale price is the cost price and override the get_sale_price function to require the cost_price as sale price for this products.

Hope this helps

Thank you Sergi for the reply.

This is the reason why I specified a concrete example. I asked about this case.

In conclusion my decision to use one template + one variant/template was right in order to have the best flexibility.

I delayed creating products for a long time because of this question. I also see that there are a number of similar posts in discuss.tryton.org, which means that there are more people confused by this.

Basically usually if you need a different price per variant, separate products should probably be used.

I guess variants are useful for example for a web-shop, to select the colour of a T-shirt.

Yes, the T-shirt is a clear case of the variants.

But we also have some customers that have products that are very similar (but not the same). As they sell using the same list price they use two diferent variants to get the proper stock of each witout having to duplicate the full information.

1 Like