Skip to content

Commit

Permalink
[FIX] budget_control: error no date commit on convert currency amount
Browse files Browse the repository at this point in the history
  • Loading branch information
newtratip authored May 2, 2024
1 parent 4f6ec23 commit eb585a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions budget_control/models/base_budget_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,18 @@ def _update_budget_commitment(self, budget_vals, reverse=False):
)
currency = hasattr(self, "currency_id") and self.currency_id or False
amount = budget_vals["amount_currency"] # init
today = fields.Date.context_today(self)
if (
not self.env.context.get("use_amount_commit")
and currency
and currency != company.currency_id
):
amount = self._get_amount_convert_currency(
budget_vals["amount_currency"], currency, company, date_commit
budget_vals["amount_currency"], currency, company, date_commit or today
)
# By default, commit date is equal to document date
# this is correct for normal case, but may require different date
# in case of budget that carried to new period/year
today = fields.Date.context_today(self)
res = {
"product_id": self.product_id.id,
"account_id": account.id,
Expand Down

0 comments on commit eb585a1

Please sign in to comment.