From ec6e183c164ef58da78133df4bf46ab5a589c723 Mon Sep 17 00:00:00 2001 From: Anjeel Haria Date: Wed, 27 Nov 2024 19:13:43 +0530 Subject: [PATCH] Made provider mandatory for rate provider mappings and updated test scripts for currency_rate_update_coingecko module pre-commit fixes --- .../tests/test_currency_rate_update_coingecko.py | 6 +++++- .../models/res_currency_rate_provider_mapping.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/currency_rate_update_coingecko/tests/test_currency_rate_update_coingecko.py b/currency_rate_update_coingecko/tests/test_currency_rate_update_coingecko.py index cb96420..d0fca55 100644 --- a/currency_rate_update_coingecko/tests/test_currency_rate_update_coingecko.py +++ b/currency_rate_update_coingecko/tests/test_currency_rate_update_coingecko.py @@ -23,7 +23,11 @@ def setUpClass(cls): cls.today = fields.Date.today() cls.eur_currency = cls.env.ref("base.EUR") cls.company = cls.Company.create( - {"name": "Test company", "currency_id": cls.eur_currency.id} + { + "name": "Test company", + "currency_id": cls.eur_currency.id, + "currency_rates_autoupdate": True, + } ) cls.lnk_currency = cls.Currency.create({"name": "LINK", "symbol": "LNK"}) cls.coingecko_provider = cls.CurrencyRateProvider.search( diff --git a/currency_rate_update_mapping/models/res_currency_rate_provider_mapping.py b/currency_rate_update_mapping/models/res_currency_rate_provider_mapping.py index e70ef96..63e3670 100644 --- a/currency_rate_update_mapping/models/res_currency_rate_provider_mapping.py +++ b/currency_rate_update_mapping/models/res_currency_rate_provider_mapping.py @@ -15,6 +15,7 @@ class ResCurrencyRateProviderMapping(models.Model): string="Provider", comodel_name="res.currency.rate.provider", ondelete="restrict", + required=True, ) provider_reference = fields.Char( required=True,