0

我一直在尝试在 OpenERP 的报告模块下创建一个 calldetails 报告。我希望报告与报告/销售点/销售详细信息中的相同。我做了文档中指定的步骤,但模块没有显示。

这是我的报告 xml(在 calldetails/report/calldata_report.xml 内)

            <?xml version="1.0"?>
            <openerp>
                    <data>
                            <report
                                    id="report_calldata"
                                    string="call details"
                                    model="calldata"
                                    name="report.calldata_report"
                                    rml="calldetails/report/calldata_report.rml"
                                    auto="False"/>
                    </data>
        </openerp>

我的模型是(在 calldetails/calldata.py 内)

        from osv import osv,fields
          class calldata(osv.osv):
            _name = 'calldata'
            _columns = {
              'Call_start': fields.datetime('Call start'),
              'Call_duration':fields.datetime('Call duration'),
              'Ring_duration':fields.float('Ring duration'),
              'Caller':fields.char('Caller'),
              'Direction':fields.char('Direction'),
              'Called_number':fields.char('Called number'),
              'Dialled_number':fields.char('Dialled number'),
              'Account':fields.char('Account'),
              'Is_Internal':fields.boolean('Is internal'),
              'Call_ID':fields.char('Call id'),
              'Continuation':fields.boolean('Continuation'),
              'Party1Device':fields.char('Party1device'),
              'Party1Name':fields.char('Party1name'),
              'Party2Device':fields.char('Party2device'),
              'Party2Name':fields.char('Party2name'),
              'Hold_Time':fields.float('Hold time'),
              'Park_Time':fields.float('Park time'),
           }
        calldata()

我的报表对象创建代码是(在 calldetails/report/calldata_report.py 里面)

        from report import report_sxw
        from osv import  osv
        class test_parser(report_sxw.rml_parse):
         def __init__(self,cr,uid,name,context):
           super(test_parser, self).__init_(cr,uid,name,context=context)
           self.localcontext.update({})
        report_sxw.report_sxw('report.calldata_report',
                               'calldata',
                                'addons/calldetails/report/calldata_report.rml',
                                parser=test_parser )

在记录文件夹中,我添加了 init .py(我导入了 calldata_report.py)和 calldata_report.rml 文件(包含从 sale/report/sale/sale_order.rml 复制的代码)

 and in (calldetails/__.openerp__.py) I added
 {"name" : "SMDR",
        "version" : "1.0",
        "author" : "Anuradha",
        "category" : "Generic Modules",
        "description": "call details",
        "website":"added website here but i cant post it due to insuffient karma",
        "depends" : ["base"],
        "init_xml" : [],
        "update_xml" : ["initial.xml","calldata_display.xml","report/calldata_report.xml"],
    #    "data":["calldata_report.xml"],
        "installable": True,
        "active": False
    }

并在 calldetails/ init .py 中添加了报告模块。请帮我找到我已经研究了很长时间的问题

4

1 回答 1

0

尝试这个

calldata_report.xml

<?xml version="1.0"?>
            <openerp>
                    <data>
                            <report
                                    id="report_calldata"
                                    string="call details"
                                    model="calldata"
                                    name="calldata.report"
                                    rml="calldetails/report/calldata_report.rml"
                                    auto="False"/>
                    </data>
        </openerp>

调用data_report.py

report_sxw.report_sxw('report.calldata.report',
                               'calldata',
                                'addons/calldetails/report/calldata_report.rml',
                                parser=test_parser )
于 2013-10-29T09:39:39.973 回答