Trợ giúp

2

How to modify the default value of currency_id in company

Avatar
Rihene

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

Ảnh đại diện
Huỷ bỏ
3 Câu trả lời
0
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


Ảnh đại diện
Huỷ bỏ
0
Avatar
Mitul Shingala
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.

Ảnh đại diện
Huỷ bỏ
0
Avatar
Andre de Kock
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
Ảnh đại diện
Huỷ bỏ