From 2649d4ba28c7fceef9be03824df27ffee6e7fa3d Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 21 Aug 2014 18:54:44 +0200 Subject: [PATCH] [FIX] account: correct some v8 decorators --- addons/account/account_invoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index d0da6e41f5e..ade4e12d426 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -83,7 +83,7 @@ class account_invoice(models.Model): return journal.currency or journal.company_id.currency_id @api.model - @api.returns('account.analytic.journal') + @api.returns('account.analytic.journal', lambda r: r.id) def _get_journal_analytic(self, inv_type): """ Return the analytic journal corresponding to the given invoice type. """ journal_type = TYPE2JOURNAL.get(inv_type, 'sale') @@ -91,7 +91,7 @@ class account_invoice(models.Model): if not journal: raise except_orm(_('No Analytic Journal!'), _("You must define an analytic journal of type '%s'!") % (journal_type,)) - return journal + return journal[0] @api.one @api.depends('account_id', 'move_id.line_id.account_id', 'move_id.line_id.reconcile_id') @@ -649,7 +649,7 @@ class account_invoice(models.Model): def _convert_ref(ref): return (ref or '').replace('/','') - @api.multi + @api.one def _get_analytic_lines(self): """ Return a list of dict for creating analytic lines for self[0] """ company_currency = self.company_id.currency_id