I want to pass database field name in my method as search parameter. How can I do it? Like below:
def my_method(self, search_parameter):
return self.partner_id.search_parameter
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I want to pass database field name in my method as search parameter. How can I do it? Like below:
def my_method(self, search_parameter):
return self.partner_id.search_parameter
Here the question would arise from where you will call this method?
Do you want the search to be on the view?
For extra parameters it is always advisable to use context you can pass any parameter as a key in context and you can use context in all the methods of odoo.
So instead of a separate parameter you can pass it as a key in context.Hope this would help.
I want to pass search parameter from the method.
Hello Ankit,
Try this
from openerp.http import request
then in your function:
print request.session.db
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ýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 12 16
|
3513 | ||
|
0
thg 3 15
|
3686 | ||
|
0
thg 7 16
|
5890 | ||
|
4
thg 12 24
|
30837 | ||
|
0
thg 1 23
|
1495 |