I have an entity with 2 fields payment (manetary) and its currency. The currency_id field in the view displays a list of all possible currencies. How can I set domain to the curency_id field so the user only will be able to select two possible currencies? In this case the options would be: US Dollar (USD) and Dominican Peso (DOP)
payment = fields.Monetary(string='Payment',currency_field='currency_id')
currency_id = fields.Many2one('res.currency', string='Currency', required=True)
And in the view:
<field name="payment"/>
<field name="currency_id"/>
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
1
Reply
1695
Views
<field name="currency_id" domain="[('name', 'in', ['USD', 'DOP'])]"/>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up