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:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
2
الردود
4178
أدوات العرض
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)
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
أغسطس 25
|
2403 | ||
|
1
يوليو 25
|
908 | ||
|
1
أغسطس 25
|
1151 | ||
|
0
مايو 25
|
1344 | ||
|
2
أبريل 25
|
3566 |