Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Qweb报告错误非类型';对象不可调用";评估时_Python_Openerp_Qweb - Fatal编程技术网

Python Qweb报告错误非类型';对象不可调用";评估时

Python Qweb报告错误非类型';对象不可调用";评估时,python,openerp,qweb,Python,Openerp,Qweb,全部 我知道这要求的不仅仅是时间,但我有太多的时间来解决这个问题 class swiss_customs_invoice_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(swiss_customs_invoice_report, self).__init__(cr, uid, name, context) self.localcontext.update({

全部 我知道这要求的不仅仅是时间,但我有太多的时间来解决这个问题

class swiss_customs_invoice_report(report_sxw.rml_parse):

  def __init__(self, cr, uid, name, context):
    super(swiss_customs_invoice_report, self).__init__(cr, uid, name, context)
    self.localcontext.update({

        'get_nw_total':self.get_nw_total,
    })

    self.nw_total=0.0

  def get_nw_total(self):
    return self.nw_total



class swiss_customs_invoice(osv.AbstractModel):
_name = 'report.account_invoice_ept.report_invoice_document_ept_b2c'
_inherit = 'report.abstract_report'
_template = 'account_invoice_ept.report_invoice_document_ept_b2c'
_wrapped_report_class = swiss_customs_invoice_report
这是我的类用来描述那个和其他XML

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
    <template id="report_invoice_document_ept_b2c">
        <t t-call="account_invoice_ept.external_layout_ept_b2c">
            <t t-set="o" t-value="o.with_context({'lang':o.partner_id.lang})" />
            <div class="page">
                <div class="row">
                    <div class="col-xs-5 col-xs-offset-7">
                        <address t-field="o.partner_id"
                            t-field-options='{"widget": "contact", "fields": ["address", "name","phone","mobile"], "no_marker": true}' />
                        <span t-if="o.partner_id.vat">
                            TIN:
                            <span t-field="o.partner_id.vat" />
                        </span>
                    </div>
                </div>                  

                <div>
                    <div class="col-xs-2">
                        <strong>Demo Defult</strong>
                        <span t-esc="get_nw_total()"></span>
                    </div>
                </div>
            </div>
        </t>
    </template>

    <template id="report_invoice_ept_b2c">
        <t t-call="report.html_container">
            <t t-foreach="docs" t-as="o">
                <t t-call="account_invoice_ept.report_invoice_document_ept_b2c"
                    t-lang="o.partner_id.lang" />
            </t>
        </t>
    </template>


    <report id="report_action_invoice_ept_b2c" string="Swiss Customs Invoice"
        model="account.invoice" report_type="qweb-pdf"
        file="account_invoice_ept.report_invoice_ept_b2c" name="account_invoice_ept.report_invoice_ept_b2c" />

</data>

锡:
演示结果

那个么,在计算和使用时,如何解决那个一直给我的错误,即非类型对象不可调用

o、 获取\u nw\u总数() docs.get_nw_total()

和其他所有在堆栈中的解决方案