2016-03-19 13 views
1

ビューを通して使用するとうまく動作する関数を作成しました。しかし、それはスケジュールアクションでは動作していません、openerpログに次のエラーを表示します。ビューボタンと連動代わりに、@のapi.multiの@のapi.modelデコレータ、とそれを呼び出す必要があり、スケジュールアクションとして動作する方法についてはスケジュールアクションを実行中にCronエラーold_apiが発生するodoo 8

TypeError: old_api() takes at least 4 arguments (3 given) 

マイモジュール

class account_invoice(models.Model): 
_name = 'account.invoice' 
_rec_name = 'invoice_number' 

@api.multi 
def create_invoice(self): 
    id = self.id 
    amount = 0 
    journal = self.env['journal.entry'] 
    for credit in self.invoice_line: 
     fee = credit.amount * credit.qty 
     if credit.account.parent.type.name == "Revenue": 
      journal.sudo().create({'account': credit.account.id, 
           'credit': fee, 
           'student_id' : self.student_id.id}) 
+0

すべてのエラーログとモデルを表示します。 'journal.entry' –

答えて

3

+0

おかげで魅力的でした。 – Suhindra

関連する問題