when I inherit from stock.picking and redefine the button_validate method, clicking on the validate button does not enter my redefined method and it cannot be traced either
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hi,
The reason, your redefined function, is not working because you do
the post super method, if we want to perform our function first we need
to do pre super function, ie,
class StockPicking(models.Model):
_inherit = 'stock.picking'
def button_validate(self):
res = super(StockPicking, self).button_validate()
for line in self:
#You need to define your code here#
return res
Hope it helps
Hi,
There is are multiple button_validate button in the picking form view, you may be changing the action related to the invisible button with same method.
Ensure, that you have updated the method for both the buttons. You can use positional argument to location the second button:
button[@name='button_validate'][2]
Thanks
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký