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

I have been trying to override a method on wizard in order to add a new parameter, I have created a module that has the same method's name as the one on the module I want to modify, but It is not taking the changes, Do you know how to override only one method on the class that executes the wizard on submit? :

class AccountConsolidationCustom(): 

def get_account_balance(self, account, partner=False, newParam=False):

get_account_balance is the method name inside the wizard script

Ảnh đại diện
Huỷ bỏ

Inheritance in odoo: https://goo.gl/4Zyc9d

Câu trả lời hay nhất

Hi,

You can change an existing method like this,

class ChangeProductionQty(models.TransientModel):
_inherit = 'change.production.qty'

@api.model
def get_account_balance(self, account, partner=False, newParam=False):
# do xyz


Make sure that you have inherited the corresponding class itself .

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 8 23
3144
2
thg 10 21
3136
1
thg 6 21
8810
3
thg 7 19
3308
1
thg 4 21
4437