diff --git a/account_invoice_inter_company/models/account_move.py b/account_invoice_inter_company/models/account_move.py index 22fc8aea58e..7bbe9dce0d9 100644 --- a/account_invoice_inter_company/models/account_move.py +++ b/account_invoice_inter_company/models/account_move.py @@ -135,6 +135,7 @@ def _inter_company_create_invoice(self, dest_company): force_number = inter_invoice.name inter_invoice.with_context(force_delete=True).unlink() # create destination invoice + self = self.with_context(**clean_context(self.env.context)) dest_invoice_data = self._prepare_invoice_data(dest_company) if force_number: dest_invoice_data["name"] = force_number @@ -214,7 +215,6 @@ def _prepare_invoice_data(self, dest_company): :rtype dest_company : res.company record """ self.ensure_one() - self = self.with_context(**clean_context(self.env.context)) # check if the journal is define in dest company self._check_dest_journal(dest_company) vals = {