[FIX] base: delete rates when deleting a currency

Also, what the point of a rate without currency?

closes odoo/odoo#58327

X-original-commit: bc00059bcd1c6475b00503e9242edd6547dbd93d
Signed-off-by: Christophe Simonis <chs@odoo.com>
This commit is contained in:
Christophe Simonis
2020-09-23 11:07:18 +00:00
parent ff209a8b36
commit 39c799cd72
+1 -1
View File
@@ -236,7 +236,7 @@ class CurrencyRate(models.Model):
name = fields.Date(string='Date', required=True, index=True,
default=lambda self: fields.Date.today())
rate = fields.Float(digits=0, default=1.0, help='The rate of the currency to the currency of rate 1')
currency_id = fields.Many2one('res.currency', string='Currency', readonly=True)
currency_id = fields.Many2one('res.currency', string='Currency', readonly=True, required=True, ondelete="cascade")
company_id = fields.Many2one('res.company', string='Company',
default=lambda self: self.env.company)