Skip to content

Commit 80ce29c

Browse files
committed
pre-commit changes and test script fixes
Added lib Updated lib Updated lib
1 parent fbbbdac commit 80ce29c

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

account_partner_default_account/models/account_move_line.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ class AccountMoveLine(models.Model):
1111
def _compute_account_id(self):
1212
res = super()._compute_account_id()
1313
for line in self.filtered(
14-
lambda l: l.display_type not in ("line_section", "line_note")
15-
and l.move_id.is_invoice()
14+
lambda ml: ml.display_type not in ("line_section", "line_note")
15+
and ml.move_id.is_invoice()
1616
):
1717
partner = line.move_id.partner_id
1818
if partner and partner.partner_default_account_id:

currency_rate_update_coingecko/models/res_currency_rate_provider_CoinGecko.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2024 Onestein
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
33
import logging
4-
from datetime import date, timedelta
4+
from datetime import timedelta
55

66
from pycgapi import CoinGeckoAPI
77

@@ -36,7 +36,7 @@ def _obtain_rates(self, base_currency, currencies, date_from, date_to):
3636
return super()._obtain_rates(base_currency, currencies, date_from, date_to)
3737
return self._get_historical_rate_from_coingecko(
3838
date_from, date_to, base_currency
39-
)
39+
)
4040

4141
def _get_historical_rate_from_coingecko(self, date_from, date_to, base_currency):
4242
"""Get all the exchange rates from 'date_from' to 'date_to'"""
@@ -48,7 +48,7 @@ def _get_historical_rate_from_coingecko(self, date_from, date_to, base_currency)
4848
for (
4949
currency
5050
) in self.currency_ids.res_currency_rate_provider_mapping_ids.filtered(
51-
lambda l: l.provider_service == self.service
51+
lambda rpm: rpm.provider_service == self.service
5252
):
5353
try:
5454
coin_data = api.coin_historical_on_date(

currency_rate_update_coingecko/tests/test_currency_rate_update_coingecko.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ def setUpClass(cls):
3030
}
3131
)
3232
cls.lnk_currency = cls.Currency.create({"name": "LINK", "symbol": "LNK"})
33-
cls.coingecko_provider = cls.CurrencyRateProvider.search(
34-
[("service", "=", "CoinGecko")], limit=1
35-
)
36-
cls.coingecko_provider.company_id = cls.company.id
3733
cls.coingecko_provider_mapping = cls.CurrencyRateProviderMapping.create(
3834
{
3935
"currency_id": cls.lnk_currency.id,
4036
"provider_service": "CoinGecko",
4137
"provider_reference": "chainlink",
4238
}
4339
)
44-
cls.coingecko_provider.write(
40+
cls.coingecko_provider = cls.CurrencyRateProvider.create(
4541
{
42+
"service": "CoinGecko",
43+
"company_id": cls.company.id,
4644
"currency_ids": [
4745
(4, cls.lnk_currency.id),
4846
],

currency_rate_update_mapping/models/res_currency_rate_provider_mapping.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ class ResCurrencyRateProviderMapping(models.Model):
1212
comodel_name="res.currency",
1313
)
1414
provider_service = fields.Selection(
15-
selection=lambda r: r.env["res.currency.rate.provider"]._fields["service"].selection,
15+
selection=lambda r: r.env["res.currency.rate.provider"]
16+
._fields["service"]
17+
.selection,
1618
string="Provider",
1719
required=True,
1820
)

l10n_nl_rgs_mis_report/tests/test_l10n_nl_rgs_mis_report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_01_rgs_balance_sheet(self):
1717

1818
def test_02_rgs_profit_loss(self):
1919
""""""
20-
report = "l10n_nl_rgs_mis_report.mis_report_l10n_nl_rgs_profit_loss"
20+
report = "l10n_nl_rgs_mis_report.mis_report_l10n_nl_rgs_pl"
2121
instance = self.env["mis.report.instance"].create(
2222
{
2323
"name": "Profit Loss",

membership_activity/models/project_project.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _compute_last_membership_activity_date(self):
3939
def get_last_membership_activity_date_by_type(self, type_id_or_xml_id):
4040
self.ensure_one()
4141
activity_type_id = type_id_or_xml_id
42-
if type(type_id_or_xml_id) == str:
42+
if isinstance(type_id_or_xml_id, str):
4343
activity_type_id = self.env.ref(type_id_or_xml_id).id
4444
matching_activities = self.membership_activity_ids.filtered(
4545
lambda a: a.type_id.id == activity_type_id

membership_activity_github/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Installation
22

3-
```
3+
`````````````````````````````
44
pip3 install PyGithub==1.59.0
5-
```
5+
`````````````````````````````
66

77
# Configure
88

membership_activity_gitlab/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Installation
22

3-
```
3+
``````````````````````````
44
pip3 install python-gitlab
5-
```
5+
``````````````````````````
66

77
# Configure
88

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ email-validator
1818
suds
1919
cachetools
2020
requests
21-
jira
2221
oauthlib
2322
requests-oauthlib
2423
requests-toolbelt
@@ -30,3 +29,4 @@ python-slugify
3029
vcrpy
3130
dnspython==2.6.1
3231
pycgapi
32+
bokeh==3.1.1

sale_recurring_payment_mollie/models/mollie_payment.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def auto_update_payments(self):
104104
payment_objs = self.sudo()._get_payment_obj(payment["id"])
105105
if payment_objs:
106106
payment_obj = payment_objs.filtered(
107-
lambda l: l.status
107+
lambda po: po.status
108108
not in ["paid", "expired", "canceled", "failed"]
109109
)
110110
if payment_obj and payment_obj.status != payment["status"]:

0 commit comments

Comments
 (0)