Skip to Content
Menu
This question has been flagged
1 Reply
1695 Views

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"/>

Avatar
Discard
Best Answer
<field name="currency_id" domain="[('name', 'in', ['USD', 'DOP'])]"/>


Avatar
Discard