[FIX] account.move.line: restore compatibility with RPC calls
Rev. d6e1d41128 removed old API
compatibility layer, but failed to preserve the ability to
call certain public methods from the RPC layer, when extra
browse_record parameters were required.
In particular the @api.v7 version of
`prepare_move_lines_for_reconciliation_widget` was dropped
and there was no way to call it with a `target_currency` RPC
parameter anymore.
This commit is contained in:
@@ -640,12 +640,16 @@ class AccountMoveLine(models.Model):
|
||||
def prepare_move_lines_for_reconciliation_widget(self, target_currency=False, target_date=False):
|
||||
""" Returns move lines formatted for the manual/bank reconciliation widget
|
||||
|
||||
:param target_currency: curreny you want the move line debit/credit converted into
|
||||
:param target_currency: currency (browse_record or ID) you want the move line debit/credit converted into
|
||||
:param target_date: date to use for the monetary conversion
|
||||
"""
|
||||
context = dict(self._context or {})
|
||||
ret = []
|
||||
|
||||
if target_currency:
|
||||
# re-browse in case we were passed a currency ID via RPC call
|
||||
target_currency = self.env['res.currency'].browse(int(target_currency))
|
||||
|
||||
for line in self:
|
||||
company_currency = line.account_id.company_id.currency_id
|
||||
ret_line = {
|
||||
|
||||
Reference in New Issue
Block a user