Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4012 Näkymät

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'),
    }

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Tekijä

No it is my own method not inherited

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
11
syysk. 16
25644
0
jouluk. 15
6962
5
marrask. 15
5819
2
lokak. 15
5818
1
heinäk. 15
7679