Skip to content

Commit

Permalink
pre-commit changes and test script fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteMeAsap committed Dec 16, 2024
1 parent fbbbdac commit a6e3310
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions account_partner_default_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class AccountMoveLine(models.Model):
def _compute_account_id(self):
res = super()._compute_account_id()
for line in self.filtered(
lambda l: l.display_type not in ("line_section", "line_note")
and l.move_id.is_invoice()
lambda ml: ml.display_type not in ("line_section", "line_note")
and ml.move_id.is_invoice()
):
partner = line.move_id.partner_id
if partner and partner.partner_default_account_id:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2024 Onestein
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
import logging
from datetime import date, timedelta
from datetime import timedelta

from pycgapi import CoinGeckoAPI

Expand Down Expand Up @@ -36,7 +36,7 @@ def _obtain_rates(self, base_currency, currencies, date_from, date_to):
return super()._obtain_rates(base_currency, currencies, date_from, date_to)
return self._get_historical_rate_from_coingecko(
date_from, date_to, base_currency
)
)

def _get_historical_rate_from_coingecko(self, date_from, date_to, base_currency):
"""Get all the exchange rates from 'date_from' to 'date_to'"""
Expand All @@ -48,7 +48,7 @@ def _get_historical_rate_from_coingecko(self, date_from, date_to, base_currency)
for (
currency
) in self.currency_ids.res_currency_rate_provider_mapping_ids.filtered(
lambda l: l.provider_service == self.service
lambda rpm: rpm.provider_service == self.service
):
try:
coin_data = api.coin_historical_on_date(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ def setUpClass(cls):
}
)
cls.lnk_currency = cls.Currency.create({"name": "LINK", "symbol": "LNK"})
cls.coingecko_provider = cls.CurrencyRateProvider.search(
[("service", "=", "CoinGecko")], limit=1
)
cls.coingecko_provider.company_id = cls.company.id
cls.coingecko_provider_mapping = cls.CurrencyRateProviderMapping.create(
{
"currency_id": cls.lnk_currency.id,
"provider_service": "CoinGecko",
"provider_reference": "chainlink",
}
)
cls.coingecko_provider.write(
cls.coingecko_provider = cls.CurrencyRateProvider.create(
{
"service": "CoinGecko",
"company_id": cls.company.id,
"currency_ids": [
(4, cls.lnk_currency.id),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class ResCurrencyRateProviderMapping(models.Model):
comodel_name="res.currency",
)
provider_service = fields.Selection(
selection=lambda r: r.env["res.currency.rate.provider"]._fields["service"].selection,
selection=lambda r: r.env["res.currency.rate.provider"]
._fields["service"]
.selection,
string="Provider",
required=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_01_rgs_balance_sheet(self):

def test_02_rgs_profit_loss(self):
""""""
report = "l10n_nl_rgs_mis_report.mis_report_l10n_nl_rgs_profit_loss"
report = "l10n_nl_rgs_mis_report.mis_report_l10n_nl_rgs_pl"
instance = self.env["mis.report.instance"].create(
{
"name": "Profit Loss",
Expand Down
2 changes: 1 addition & 1 deletion membership_activity/models/project_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _compute_last_membership_activity_date(self):
def get_last_membership_activity_date_by_type(self, type_id_or_xml_id):
self.ensure_one()
activity_type_id = type_id_or_xml_id
if type(type_id_or_xml_id) == str:
if isinstance(type_id_or_xml_id, str):
activity_type_id = self.env.ref(type_id_or_xml_id).id
matching_activities = self.membership_activity_ids.filtered(
lambda a: a.type_id.id == activity_type_id
Expand Down
4 changes: 2 additions & 2 deletions membership_activity_github/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Installation

```
`````````````````````````````
pip3 install PyGithub==1.59.0
```
`````````````````````````````

# Configure

Expand Down
4 changes: 2 additions & 2 deletions membership_activity_gitlab/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Installation

```
``````````````````````````
pip3 install python-gitlab
```
``````````````````````````

# Configure

Expand Down
2 changes: 1 addition & 1 deletion sale_recurring_payment_mollie/models/mollie_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def auto_update_payments(self):
payment_objs = self.sudo()._get_payment_obj(payment["id"])
if payment_objs:
payment_obj = payment_objs.filtered(
lambda l: l.status
lambda po: po.status
not in ["paid", "expired", "canceled", "failed"]
)
if payment_obj and payment_obj.status != payment["status"]:
Expand Down

0 comments on commit a6e3310

Please sign in to comment.