Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5516 Lượt xem

Hi, I don't know if this is possible in Odoo 13

I don't know if this is possible in Odoo 13, to update the values of the tree view of sales when I change the pricelist clicking in a button

For example.

I have selected pricelist 1 where my product demo is set to 10 usd.

I add my product and then I realized than I should use the pricelist 2 where the product price is 20usd.

I added a button called "Update price" and added the function

def action_refresh(self):
return {
'type': 'ir.actions.client',
'tag': 'reload',
}

but this refresh the page and no the value of the price. 

What should I do so is updated when I clic on the button? I know that I could delete it and add it again but Im thinking in a scenary where I added like 100 products or so

Thank you in advance.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

Not sure what exactly you looks for, here you have added a new button and called a function on clicking the button, inside the code you have written the code to refresh the view, so on clicking the button it will simply reload the screen without doing anything,  so inside the function action_refresh you can implement your logic and after that reload the screen if necessary.


def action_refresh(self):
# apply the logic here
return {
'type': 'ir.actions.client',
'tag': 'reload',
}


Thanks

Ảnh đại diện
Huỷ bỏ
Tác giả

Thank you for your answer

I use the module https://apps.odoo.com/apps/modules/12.0/sale_order_price_recalculation/ and that did exactly what I needed

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 20
3364
0
thg 2 22
2126
1
thg 1 21
4472
2
thg 12 22
4890
1
thg 12 21
3836