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 ?