Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
1088 Vistas

We have a shop with about 5000 different products. Each product can have 5-50+ colour variants. 

Some of the variant colours are discontinued by the manufacturer.

On these variants we want to offer a certain discount %


We now mark the discontinued colours with a specific tag (on the variant). 


How can we define a rule to give x% discounts on the variants with tag y linked to it ? 
The discounted price should be available in POS, webshop and manual order entry. 

I appreciate all help on this topic.


(we are using V17)

Avatar
Descartar
Autor Mejor respuesta

Thanks Anaghan,

Option 1 is not feasable because the category is also used to direct the financial transactions in our accountancy and therefor does not offer much flexibility. 

Option 2 we tried and it calculates the discount on the webshop on the checkout page, but it does not show the prices with a discount on the product page. 
We also noticed that in POS the entered discount is shown on all products and not only on the selection we made. 


Avatar
Descartar
Mejor respuesta

Hi, you have two options in Odoo that can fit your requirements. You can choose the one that benefits you the most:

  1. POS Pricelist: Allows you to set different product pricing based on product category or by selecting specific products.
  2. POS Discount & Loyalty: Provides features for applying discounts and offering loyalty programs to customers. here is the option product tag.

Please check the picture below to see the details and let me know if you have any questions.

Avatar
Descartar
Mejor respuesta

Hello, one solution maybe is Server action, where modified with python code. In this server action you should search the products with the tags are you interested and modify the field discount.



This solution is easily to programming in odoo with python. You don t need to use a IDE, you con programming in Odoo, in Settings> Technical> Server Action

Code example in comment.

Avatar
Descartar

Code Example:

# Create discount value for products with tag 'Discontinued'
discount_percentage = 20 # 20% discount

# Search for the tag 'Discontinued'
discontinued_tag = env["product.tag"].search([("name", "=", "Discontinued")], limit=1)
if discontinued_tag:

discontinued_products = env["product.product"].search(
[("tag_ids", "in", discontinued_tag.id)]
)

# Apply discount to all products with the 'Discontinued' tag
for product in discontinued_products:
original_price = product.lst_price
discounted_price = original_price * (1 - discount_percentage / 100)
product.lst_price = discounted_price

else:
raise UserError("Tag 'Discontinued' not found")

Publicaciones relacionadas Respuestas Vistas Actividad
3
ene 21
10769
1
mar 18
3525
0
feb 17
2604
0
ago 15
3693
2
nov 24
2301