This question has been flagged
3 Replies
5266 Views

Hello everybody:

     Please, i want to know how to modify the default value of currency_id in company with the new api

THanks a lot in advance

Best regards

Avatar
Discard
Best Answer

Hello Rihene ,

Activate developer mode,

Settings > Actions > User-defined Defaults 

And create your record with res.company model

If you want to put by code then you can do it by data in Odoo custom module.

Thanks


Avatar
Discard
Best Answer

hello

Update your code into the method _get_user_currency(). into the res.company object.

or also you can achieve this using the default_get method.

Avatar
Discard
Best Answer

Using Python you can change it like so (I changed it to South African Rand for example):

class ResCompany(models.Model):
_inherit = 'res.company'

@api.model
def _get_euro(self):
return self.sudo().env.ref('base.ZAR').id
Avatar
Discard