how to remove the value of the taxes_id field from product_template in all companies at once?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Hi,
This can be done by a server action easily.
Steps:
1. Activate developer mode
2. Settings - > Technical -> Actions -> Server Actions, click create
3. Set Name as Clear Taxes, Model: Product or Product Template, Action To Do: Execute Python Code
4. In Python Code Section, write below code:
records.write({'taxes_id': [(5,0,0)]})
5. Click Create Contextual Action
6. Go to products tree view, select all records from view and click this created action
See : https://www.youtube.com/watch?v=TXBjlnfbZg8
Thanks
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
1
nov. 22
|
2224 | ||
|
2
janv. 25
|
3476 | ||
|
1
sept. 25
|
2027 | ||
|
1
juin 25
|
2069 | ||
|
3
juil. 25
|
3660 |
this method delete only for current company, i would like to delete for all company at once
from the company selector select all companies, before selecting the products, how many companies you have ?
12 companies
If you cant select all companies at once or cant do one by one.
Set model as ir.actions.server in the server action, and python code as:
env['product.template'].sudo().search([]).write({'taxes_id': [(5,0,0)]})
Thanks !!! that works well.