コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4052 ビュー

I am using openerp 7 api for my development.I want to inherit report of partner ledger.The function is not executing, I think the syntax is correct but I not getting where I have done mistake.

from openerp.osv import fields,osv
class report_partnerledger(osv.AbstractModel):
    _inherit = 'report.account.report_partnerledger'

    def _check_status(self, cr, uid, ids, context=None):
        print "Entering check status func"
        iscredit = self.cr.execute("SELECT l.credit FROM account_move_line AS l")
        if(iscredit == 0):
            docm="Invoice"
        else:
            docm="Refunded Invoice"
        print docm
        return docm

    _columns = {
        'doc_info': fields.function(_check_status,type='char'),
    }

アバター
破棄
最善の回答

Is '_check_status' is inherited method? If yes, try to super the original '_check_status' method if you added codes to it.

アバター
破棄
著作者

No it is my own method not inherited

関連投稿 返信 ビュー 活動
11
9月 16
25745
0
12月 15
7035
5
11月 15
5874
2
10月 15
5921
1
7月 15
7744