Odoo Help

4

0
2 Answers
6
Avatar

Omal Bastin India

--Omal Bastin--

2158
| 7 7 10
Kochi, Kerala, India
--Omal Bastin--

Swiming deep into openERP/ODOO

Omal Bastin India
5/24/13, 8:53 AM

Hi, Goto Settings > Technical > Actions > User defined Defaults, there you can find that default value is set as en_US, you can delete this record or change it to your language

1 Comment
Pravitha Qatar
6/18/13, 5:22 AM

This was what i wanted

9
Avatar

ClueLogics Technologies Pvt. Ltd. India

--ClueLogics Technologies Pvt. Ltd.--
6213
| 7 5 10
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 8:39 AM

Hey Pravitha

DO it as below :

inherit your res.partner

and add this new function in that class (res_partner)

   def _get_mylang(self, cr, uid, context=None):
         ids = self.pool.get('res.lang').search(cr, uid, [], context=context)
         res = self.pool.get('res.lang').read(cr, uid, ids, ['code', 'name'], context)     
         return [(j['code'], j['name']) for j in res] + [('','')]

and then just add this method in _defauts link below

   _defaults = {
       'lang':_get_mylang,
}

or also you can go through -- > Settings > Technical > Actions > User defined Defaults thats it

Thanks
Sandeep

15 Comments
Pravitha Qatar
5/24/13, 8:52 AM

Helo sir, Thankyou for the reply . can i ask you somthing will it show english also in the selection?

Omal Bastin India
5/24/13, 8:57 AM

Hi, your function will only return the id of the language. then lang field is actually a selection. So the function should be like def _lang_get(self, cr, uid, context=None): lang_pool = self.pool.get('res.lang') ids = lang_pool.search(cr, uid, [('code','=','en_GB')], context=context) res = lang_pool.read(cr, uid, ids, ['code'], context) return r['code']

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:06 AM

is this a selection field ??

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:07 AM

this will work for money2one relation

Pravitha Qatar
5/24/13, 9:11 AM

yes it is a selection field

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:14 AM

see updated answer now

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:15 AM

all the available language will be seen into that selection field

Omal Bastin India
5/24/13, 9:18 AM

its actually wrong!! please check it

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:22 AM

whats wrong?? , let me know

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 9:30 AM

man, it should not be wrong .......:))

Omal Bastin India
5/24/13, 10:02 AM

your _get_mylang will return a list of tuples. To get a default value, you need to pass the key value of the selection list. jou just check it in your local server

ClueLogics Technologies Pvt. Ltd. India
5/24/13, 10:03 AM

oh man it is fine .:):) and for your information ,, selection gets tuple value with (key,value)

Omal Bastin India
5/24/13, 10:08 AM

:-) nothing more to say

Pravitha Qatar
6/18/13, 5:21 AM

thankyou for the help sir

ClueLogics Technologies Pvt. Ltd. India
6/18/13, 5:30 AM

ok that's fine

Ask a Question
Writer
Keep Informed
2 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now