Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
1178 Zobrazení

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
Zrušit
Autor Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit

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")

Related Posts Odpovědi Zobrazení Aktivita
3
led 21
10832
1
bře 18
3557
0
úno 17
2637
0
srp 15
3725
2
lis 24
2379