Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
1613 Переглядів

Hello,


We have a very large product set (vehicle parts) with subsequent speed issues, so we archived  80-90% of these product catalogs to have acceptable speed, but we still sell some of these  archived products on customer request/requirement.

We are looking for a solution to automatically unarchive products when they are added to a sales order.

I tried to set up an automated action,  but can't seem to get it to work. Any tips and tricks welcome...

We are on Odoo 16 sh.


Thanks!



Аватар
Відмінити
Найкраща відповідь

Hi,
You can set up an automated action in the database as shown in the below image, the images are from v17, but you can follow the same in 16 also.


Python code to add:




Code:
for line in records:

    if line.product_id and not line.product_id.active:

        line.product_id['active'] = True



Thanks

Аватар
Відмінити
Автор Найкраща відповідь

Hi,

As new user not able to use the comments so...

The python code in the automated action seems to do the trick perfectly.

Thank you Niyas Raphy, this helps our daily process out a lot!


Rudi

Аватар
Відмінити
Найкраща відповідь

Hi,

Try this blog:https://www.cybrosys.com/blog/automated-actions-automation-in-the-odoo-16-erp


Hope it helps

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
трав. 23
1446
0
бер. 24
1221
1
груд. 23
3985
2
квіт. 25
16774
2
серп. 25
459