Hi, I'm using openerp V7. I am trying to use the need action mechanism which would show the no. of pending action on the menu. But i don't understand how to integrate it with the menu. I inherited the class and implemented the override method as it was documented. but i have no idea what to do next?
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,
to make a need action your model must inherit from ir.needaction_mixin
and add a _needaction_domain_get
method
class MyModel(osv.Model):
_name = 'my.model'
_inherit = [
'my.model',
'ir.needaction_mixin',
]
def _needaction_domain_get(self, cr, uid, context=None):
return `a domain on this model`
Hi Chaudhuri and Jean-Sébastien!
thanks to both respectively for your question and your answer. But I need your help ...how should I do if the same model is linked to many actions recorded with different domains? eg: an action for draft operations, and an action for done operations
I found a solution: def _needaction_domain_get(selft, cr, uid, context=None): return ['|',('state','=','draft'),('state','=','done')]
You should open a new question. In the function you can check the state, and use conditionals to return different domains depending on this state.
Hi, If you have different actions for same model then u need to assign domains on every action. Lets take an Example of class sale.order which has 2actions with same model in xml file-> sale_order_action1: domain[('state','in',['draft','cancel;'])] sale_order_action2: domain[('state','not in',['draft','cancel;'])] Now when you override needaction_domain_get method then based on 2domains you badge count will be shown on UI.If any doubts contact me - shashank.verma0020@gmail.com skype: shashank_verma00200
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ýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
7
thg 1 16
|
6151 | ||
|
21
thg 7 17
|
14762 | ||
What is needaction_menu_ref?
Đã xử lý
|
|
1
thg 10 17
|
4358 | |
|
0
thg 10 17
|
3200 | ||
Needaction notification number
Đã xử lý
|
|
1
thg 9 17
|
3969 |