コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3047 ビュー

how to remove the value of the taxes_id field from product_template in all companies at once?

アバター
破棄
著作者

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.

最善の回答

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
11月 22
2404
2
1月 25
3709
1
9月 25
2318
1
6月 25
2337
3
7月 25
3825