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
- 项目
- MRP
此问题已终结
2
回复
4697
查看
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)
| 相关帖文 | 回复 | 查看 | 活动 | |
|---|---|---|---|---|
|
|
0
12月 25
|
8 | ||
|
|
0
12月 25
|
118 | ||
|
|
1
12月 25
|
229 | ||
|
|
0
12月 25
|
253 | ||
|
|
1
12月 25
|
422 |