Hello everybody!!!
I want to put a value by defaut in the currency_id of res_ompany model.
SO i have tried this but nothing appears in odoo.
def _get_default_currency(self, cr, obj ,context=None):
print('----------------CURRENCY--------------------')
currency_obj = self.pool.get('res.currency')
print ('test1')
print currency_obj
currency_ids = currency_obj.search(cr, obj, [('name','=','DTN')])
print currency_ids
currency_res = currency_obj.read(cr,obj,currency_ids,['id'],context=context)
print currency_res
for v in currency_res :
print v['id']
currency_id = v['id']
return currency_id
_defaults = {'currency_id' : _get_default_currency}
Can anyone help please.
Thanks a lot in advvance.
Best Regards.