Skip to content

Commit

Permalink
[FIX] Create multi method not overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
baptiste-n42 committed Jun 24, 2024
1 parent cfbcd57 commit 61b0e09
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions hr_contract_currency/models/hr_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def _compute_currency_id(self):
for rec in self:
rec.currency_id = rec.company_id.currency_id

@api.model
def create(self, vals):
if vals.get("company_id") and not vals.get("currency_id"):
company = self.env["res.company"].browse(vals.get("company_id"))
vals["currency_id"] = company.currency_id.id
return super().create(vals)
@api.model_create_multi
def create(self, val_list):
for vals in val_list:
if vals.get("company_id") and not vals.get("currency_id"):
company = self.env["res.company"].browse(vals.get("company_id"))
vals["currency_id"] = company.currency_id.id
return super().create(val_list)

0 comments on commit 61b0e09

Please sign in to comment.