I'm having many2one which has relation "res.currency". I need to set default currency value in Indian currency by default and set this field must not change by user. How must I do this?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Contabilidad
- Inventario
- PoS
- Project
- MRP
Se marcó esta pregunta
2
Respuestas
4187
Vistas
currency_id = fields.Many2one('res.currency',default=lambda self: self.env['res.currency'].search([('name', '=', 'INR')]).id,readonly=True)
You can get the currency using xml_id rather name
def _default_country_id(self):
return self.env.ref('base.INR').id
currency_id = fields.Many2one('res.currency',string='Currency',default=_default_country_id,readonly=True)
¿Le interesa esta conversación? ¡Participe en ella!
Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.
RegistrarsePublicaciones relacionadas | Respuestas | Vistas | Actividad | |
---|---|---|---|---|
|
2
ago 25
|
2409 | ||
|
1
jul 25
|
909 | ||
|
1
ago 25
|
1151 | ||
|
0
may 25
|
1344 | ||
|
2
abr 25
|
3567 |