mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
Proper use of context with new api
This commit is contained in:
@@ -79,17 +79,12 @@ class AccountInvoice(Model):
|
||||
@api.model
|
||||
def _prepare_refund(self, invoice, date=None, period_id=None,
|
||||
description=None, journal_id=None):
|
||||
|
||||
context = self.env.context
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
result = super(AccountInvoice, self)._prepare_refund(
|
||||
invoice, date=date, period_id=period_id, description=description,
|
||||
journal_id=journal_id)
|
||||
|
||||
if context.get('claim_id'):
|
||||
result['claim_id'] = context['claim_id']
|
||||
if self.env.context.get('claim_id'):
|
||||
result['claim_id'] = self.env.context.get('claim_id')
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user