Hello friends,
I am working in V 7.0. I have to set a default values for many2many field name called "Expenses" (more than one values), when click on "Add an item".Please reply me for this situation .Thanks in Advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello friends,
I am working in V 7.0. I have to set a default values for many2many field name called "Expenses" (more than one values), when click on "Add an item".Please reply me for this situation .Thanks in Advance
Hi friends, This code worked for me.Make use of it
def _get_expense_id(self, cr, uid, context=None):
result = []
if context is None:
context = {}
name = ["Selling Expenses","Grading Expenses","Stock Maintenance Expenses", "Fumigation Charges"]
expense_obj = self.pool.get('expense.deduct')
res = expense_obj.search(cr, uid, [('name', '=', name )])
for eachid in res:
result.append(eachid)
return result or result[0] or False
_defaults = { 'expense_deduct_id': _get_expense_id, }
it does not work when you set the default value for that field in the related model?
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 | |
---|---|---|---|---|
|
2
thg 2 24
|
28861 | ||
|
1
thg 2 24
|
2418 | ||
Security (6,0) and (4) in openerp
Đã xử lý
|
|
3
thg 6 23
|
56248 | |
|
0
thg 7 24
|
3586 | ||
|
0
thg 7 22
|
60 |