-
-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File "/opt/l10n-italy/l10n_it_reverse_charge/models/account_move.py", line 421, in generate_self_invoice force_conversion_date=self.rc_original_purchase_invoice_ids[0].invoice_date, File "/opt/odoo/odoo/models.py", line 5731, in __getitem__ return self.browse((self._ids[key],)) IndexError: tuple index out of range + pre-commit
- Loading branch information
Showing
2 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
from odoo import models | ||
|
||
|
||
class ResCurrency(models.BaseModel): | ||
_inherit = 'res.currency' | ||
_inherit = "res.currency" | ||
|
||
def _convert(self, from_amount, to_currency, company, date, round=True): | ||
if self.env.context.get('force_conversion_date'): | ||
return super(ResCurrency, self)._convert(from_amount, to_currency, company, date=self.env.context['force_conversion_date'], round=round) | ||
if self.env.context.get("force_conversion_date"): | ||
return super(ResCurrency, self)._convert( | ||
from_amount, | ||
to_currency, | ||
company, | ||
date=self.env.context["force_conversion_date"], | ||
round=round, | ||
) | ||
|
||
return super(ResCurrency, self)._convert(from_amount, to_currency, company, date, round) | ||
return super(ResCurrency, self)._convert( | ||
from_amount, to_currency, company, date, round | ||
) |