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
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
2
Replies
3410
Views
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)
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
271 | ||
|
1
Oct 24
|
335 | ||
|
4
Oct 24
|
326 | ||
Connect Odoo with unopim
Solved
|
|
2
Oct 24
|
362 | |
|
2
Dec 24
|
673 |