Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

QWebTemplateNotFound: External ID not found in the system

By
Erhuvwu Akpobaro
on 1/30/15, 8:09 AM 2,661 views

Hey people , i need help with an error i keep getting when i try to print a custom report , 

ther error log :

line 924, in xmlid_lookup raise ValueError('External ID not found in the system: %s' % (xmlid)) QWebTemplateNotFound: External ID not found in the system: cm_rental_contracts.report_retailcontracts

The funny thing is tthat if i go to settings > reports > all my custom reports are there.

My code for printing the custom report :

 def print_contract(self, cr, uid, ids, context=None):
        """ 
        This function prints the Rental Contracts 
        """
        assert len(ids) == 1, 'This option should only be used for a single id at a time.'
        #self.sent = True
        #context = dict(context or {}, active_ids=ids)
        Printfood_obj = self.pool.get('cm.rental.contracts')
        val = Printfood_obj.browse(cr,uid,ids, context=context)
        if(val.contract_category == "Food"):
            return self.pool['report'].get_action(cr, uid, ids, 'cm_rental_contracts.report_foodcontracts', context=context)
        elif(val.contract_category == "Retail"):
            return self.pool['report'].get_action(cr, uid, ids, 'cm_rental_contracts.report_retailcontracts', context=context)
        elif(val.contract_category == "Storage"):
            return self.pool['report'].get_action(cr, uid, ids, 'cm_rental_contracts.report_storagecontracts', context=context)
        else:
             return self.pool['report'].get_action(cr, uid, ids, 'cm_rental_contracts.report_retailcontracts', context=context)

 

the xml :

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            id="action_report_print_contract" 
            string="Tenant/unit rental Contracts" 
            model="cm.rental.contracts" 
            report_type="qweb-pdf"
            name="cm_rental_contracts.report_foodcontracts" 
            file="cm_rental_contracts.report_foodcontracts"
             attachment_use="True"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        /> 
    </data>
</openerp>

 

Does any one no what the error could be and how i can solve it ?

0
Erhuvwu Akpobaro
On 1/30/15, 8:23 AM

Hello zbik i for got to add them to the last post : 

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            id="action_report_print_retail_contract" 
            string="Tenant/unit retail Contracts" 
            model="cm.rental.contracts" 
            report_type="qweb-pdf"
            name="cm_rental_contracts.report_retailcontracts" 
            file="cm_rental_contracts.report_retailcontracts"
             attachment_use="True"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        /> 
    </data>
</openerp>

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <report 
            id="action_report_print_storage_contract" 
            string="Tenant/unit storage Contracts" 
            model="cm.rental.contracts" 
            report_type="qweb-pdf"
            name="cm_rental_contracts.report_storagecontracts" 
            file="cm_rental_contracts.report_storagecontracts"
             attachment_use="True"
            attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')"
        /> 
    </data>
</openerp>

i still get th error here is my 

__openerp__.py:

##############################################################################
#
#    Zeraxis Add-on Modules for the OpenObject Platform
#    Copyright (C) 2014 Zeraxis Limited (http://www.zeraxis.com)
#
#    OpenERP & OpenObject originally created by Tiny SPRL (http://tiny.be)
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

{
    "name" : "Camden Market Managers",
    "version" : "1.0",
    "author" : "Zeraxis Ltd",
    "category" : "Tools",
    "website": "http://www.zeraxis.com",
    "description": """Custom module to extend features for market managers """,
    "depends" : ["base" , "report" , "analytic" , "account"],
    "data" : [
              "cm_rental_contracts_view.xml",
              "cm_account_analytic_account_view.xml",
              "report/cm_report_retail_contracts.xml",
              "report/cm_report_storage_contracts.xml",
              "report/cm_report_food_contracts.xml",
              "security/ir.model.access.csv",
              "views/report_retailcontracts.xml",
              "views/report_foodcontracts.xml",
              "views/report_storagecontracts.xml",
                  "views/cm_market_managers_view.xml"
                  
     ],
    "demo": [],
    "active": False,
    "installable": True
}

 

 

You check whether the report with name report_foodcontracts exists in the system (In Settings/Reports/Reports)?

zbik
on 1/30/15, 8:45 AM

hey the problem is fixed , maybe a bug , but all i did was resatrt the server and update all modules

Erhuvwu Akpobaro
on 1/30/15, 9:54 AM
0

zbik

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 1/30/15, 8:20 AM

In XML you have only definded cm_rental_contracts.report_foodcontracts. I do not see report_retailcontracts and therefore error is: External ID not found in the system: cm_rental_contracts.report_retailcontracts

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/30/15, 8:09 AM
Seen: 2661 times
Last updated: 4/12/15, 4:32 PM