Skip to content

Commit

Permalink
[FIX] sustainability_hr_expense_report: return False if no account
Browse files Browse the repository at this point in the history
  • Loading branch information
jguenat committed Jan 9, 2025
1 parent 0f27725 commit 1275029
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sustainability_hr_expense_report/models/hr_expense.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def _get_line_amount(self) -> float:

def can_use_account_id_carbon_value(self) -> bool:
self.ensure_one()
return self.account_id.can_compute_carbon_value("in")
return (
self.account_id.can_compute_carbon_value("in") if self.account_id else False
)

def get_account_id_carbon_compute_values(self) -> dict:
self.ensure_one()
Expand Down

0 comments on commit 1275029

Please sign in to comment.