Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • Hotel
    Real Estate
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    Consulting
    • Accounting Firm
    • Odoo पार्टनर
    • Marketing Agency
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

External ID not found in the system

Subscribe

Get notified when there's activity on this post

This question has been flagged
wizardreport
4 Replies
6524 Views
Avatar
Dunia

Hello,

I am trying to make a report using the wizard window but every time I try to install the module I get the same error as if I didn't recognize the external id of the report

This is my xml.file

<record model="ir.ui.view" id="solicitud_resumen_form">
<field name="name">solicitud.resumen.viajes.wizard</field>
<field name="model">solicitud.resumen.viajes</field>
<field name="arch" type="xml">
<form string="Resumen de viajes" >
<group >
<field name="anno" />
<field name="mes" />
</group>
<footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
<button string="Cancel" class="btn btn-secondary" special="cancel" />
</footer>
</form>
</field>
</record>




<record model="ir.actions.act_window" id="flota_resumen_viaje_action">
<field name="name">Resumen de viajes PDF</field>
<field name="res_model">solicitud.resumen.viajes</field>
<field name="view_mode">form</field>
<field name="view_id" ref="solicitud_resumen_form" />
</record>

and my report is

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report
id="flota_solicitud_report"
string="Resumen de viajes"
model="solicitud.resumen.viajes"
report_type="qweb-pdf"
name="flota.print_resumen_report"
file="flota.print_resumen_report"
/>

<template id="print_resumen_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="resumen_viajes">
<t t-call="web.external_layout">
<div class="page">
<div class="col-sm-6">
<table border="0" align="center" style="font-size:16pt;">
<tr >
<td align="center" valign="center" colspan="6">
RESUMEN DE LOS VIAJES
</td>
</tr>
<tr><td colspan="6" style="height:10pt;"></td></tr>
<tr >
<td align="left" colspan="2">
<label><strong>Año:</strong></label>
<t t-esc="resumen_viajes.anno"/>
<label>---</label>

<label><strong>Mes:</strong></label>
<t t-esc="resumen_viajes.mes"/>
</td>
<td colspan="4"></td>
</tr>

<tr>
<td valign="right" colspan="6">
<table class="table table-bordered mb32" style="table-layout:auto;font-size:14pt;">
<tr>
<td><strong>Centro de Costo</strong></td>
<td colspan="3" align="center"><strong>Viajes Planificados</strong>
</td>
<td colspan="3" align="center"><strong>Viajes Imprevistos</strong>
</td>
<td ><strong>Viajes de Servicios </strong></td>
<td ><strong>% Cumpl Transp. </strong></td>
</tr>

<tr > <td style="border-top:0;"></td>
<td><strong>Solicitados </strong></td>
<td><strong>Susp/Transp </strong></td>
<td><strong>Susp/Área </strong></td>

<td><strong>Solicitados </strong></td>
<td><strong>Susp/Transp </strong></td>
<td><strong>Susp/Área </strong></td>

<td style="border-top:0;"></td>
<td></td>
</tr>
<t t-foreach="resumen_viajes._get_Solicitudes()" t-as="centro_name">
<tr colspan="2"><td > <div style="font-size:14pt;margin-bottom:5pt;" ><t t-esc="centro_name"/></div></td>


<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_SolicitudesP(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Transporte_Plan(centro_name)"/></div></td>
<td > <div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Area_Plan(centro_name)"/></div></td>


<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_SolicitudesI(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._getTotal_Suspendidos_Transporte_Im(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._getTotal_Suspendidos_Area_Im(centro_name)"/></div></td>

<td > <div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Solici_Serv(centro_name)"/></div></td>

<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_porciento(centro_name)"/></div></td>


</tr>
<tr>
</tr>
</t>
<tr>
<td><strong>Total</strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_SolicitudesP()" /></strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_Transporte_Plan()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._get_TotalFinal_Area_Plan()" /></strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_SolicitudesI()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._getTotal_Final_Suspendidos_Transporte_Im()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._getTotal_Final_Suspendidos_Area_Im()"/></strong></td>
<td ><strong><t t-esc="resumen_viajes._get_Total_Final_Solici_Serv()"/> </strong></td>
<td ><strong><t t-esc="resumen_viajes._get_Total_porciento()"/></strong></td>
</tr>

</table>
</td>
</tr>
</table>
</div>
</div>
</t>
</t>
</t>
</template>

</odoo>
0
Avatar
Discard
Sudhir Arya (ERP Harbor Consulting Services)

It would be more helpful if you post the error/traceback as well.

Dunia
Author

This is Error/traceback

Odoo Server Error

Traceback (most recent call last):

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\cache.py", line 85, in lookup

r = d[key]

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\func.py", line 69, in wrapper

return func(self, *args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\lru.py", line 44, in __getitem__

a = self.d[obj].me

KeyError: ('ir.model.data', <function IrModelData.xmlid_lookup at 0x05944588>, 'flota.resumen_viaje_report')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 713, in parse

self._tag_root(de)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 675, in _tag_root

f(rec)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 564, in _tag_record

f_val = _eval_xml(self, field, env)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 143, in _eval_xml

+_process("".join(etree.tostring(n, encoding='unicode') for n in node))

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 132, in _process

self.idref[id] = self.id_get(id)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 658, in id_get

res = self.model_id_get(id_str, raise_if_not_found)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 664, in model_id_get

return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_model.py", line 1659, in xmlid_to_res_model_res_id

return self.xmlid_lookup(xmlid)[1:3]

File "<decorator-gen-24>", line 2, in xmlid_lookup

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\cache.py", line 90, in lookup

value = d[key] = self.method(*args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_model.py", line 1648, in xmlid_lookup

raise ValueError('External ID not found in the system: %s' % xmlid)

ValueError: External ID not found in the system: flota.resumen_viaje_report

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 619, in _handle_exception

return super(JsonRequest, self)._handle_exception(exception)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 309, in _handle_exception

raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\pycompat.py", line 14, in reraise

raise value

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 664, in dispatch

result = self._call_function(**self.params)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 345, in _call_function

return checked_call(self.db, *args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\service\model.py", line 93, in wrapper

return f(dbname, *args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 338, in checked_call

result = self.endpoint(*a, **kw)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 910, in __call__

return self.method(*args, **kw)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\http.py", line 510, in response_wrap

response = f(*args, **kw)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1324, in call_button

action = self._call_kw(model, method, args, kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\web\controllers\main.py", line 1312, in _call_kw

return call_kw(request.env[model], method, args, kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\api.py", line 395, in call_kw

result = _call_kw_multi(method, model, args, kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\api.py", line 382, in _call_kw_multi

result = method(recs, *args, **kwargs)

File "<decorator-gen-58>", line 2, in button_immediate_install

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 72, in check_and_log

return method(self, *args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 463, in button_immediate_install

return self._button_immediate_function(type(self).button_install)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_module.py", line 573, in _button_immediate_function

modules.registry.Registry.new(self._cr.dbname, update_module=True)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules\registry.py", line 86, in new

odoo.modules.load_modules(registry._db, force_demo, status, update_module)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules\loading.py", line 420, in load_modules

loaded_modules, update_module, models_to_check)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules\loading.py", line 312, in load_marked_modules

perform_checks=perform_checks, models_to_check=models_to_check

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules\loading.py", line 222, in load_module_graph

load_data(cr, idref, mode, kind='data', package=package, report=report)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\modules\loading.py", line 68, in load_data

tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 737, in convert_file

convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 804, in convert_xml_import

obj.parse(doc.getroot())

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 722, in parse

exc_info[2]

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\pycompat.py", line 13, in reraise

raise value.with_traceback(tb)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 713, in parse

self._tag_root(de)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 675, in _tag_root

f(rec)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 564, in _tag_record

f_val = _eval_xml(self, field, env)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 143, in _eval_xml

+_process("".join(etree.tostring(n, encoding='unicode') for n in node))

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 132, in _process

self.idref[id] = self.id_get(id)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 658, in id_get

res = self.model_id_get(id_str, raise_if_not_found)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\convert.py", line 664, in model_id_get

return self.env['ir.model.data'].xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_model.py", line 1659, in xmlid_to_res_model_res_id

return self.xmlid_lookup(xmlid)[1:3]

File "<decorator-gen-24>", line 2, in xmlid_lookup

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\tools\cache.py", line 90, in lookup

value = d[key] = self.method(*args, **kwargs)

File "C:\Program Files (x86)\Odoo 13.0\server\odoo\addons\base\models\ir_model.py", line 1648, in xmlid_lookup

raise ValueError('External ID not found in the system: %s' % xmlid)

odoo.tools.convert.ParseError: "External ID not found in the system: flota.resumen_viaje_report" while parsing file:/c:/program files (x86)/odoo 13.0/server/odoo/addons/flota/views/flota_vehiculo_views.xml:2, near

<odoo>

Ray Carnes (ray)

"resumen_viaje_report" does not exist anywhere in your post except the error message. Have you shared all of your XML files?

Avatar
Dunia
Author Best Answer

I already managed to get the wizard window up, but when I make this call:

return self.env.ref('flota.action_resumen_report').report_action(self)
it give External ID flota.action_resumen_report
my xml report now is
<report
id="action_resumen_report"
string="Resumen de viajes"
model="flota.resumen.viajes"
report_type="qweb-pdf"
name="flota.print_resumen_report"
file="flota.print_resumen_report"
menu="False"/>
<template id="print_resumen_report">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="resumen_viajes">
<t t-call="web.external_layout">
<div class="page">
<div class="col-sm-6">
<table border="0" align="center" style="font-size:16pt;">
<tr >
<td align="center" valign="center" colspan="6">
RESUMEN DE LOS VIAJES
</td>
</tr>
<tr><td colspan="6" style="height:10pt;"></td></tr>
<tr >
<td align="left" colspan="2">
<label><strong>Año:</strong></label>
<t t-esc="resumen_viajes.anno"/>
<label>---</label>

<label><strong>Mes:</strong></label>
<t t-esc="resumen_viajes.mes"/>
</td>
<td colspan="4"></td>
</tr>

<tr>
<td valign="right" colspan="6">
<table class="table table-bordered mb32" style="table-layout:auto;font-size:14pt;">
<tr>
<td><strong>Centro de Costo</strong></td>
<td colspan="3" align="center"><strong>Viajes Planificados</strong>
</td>
<td colspan="3" align="center"><strong>Viajes Imprevistos</strong>
</td>
<td ><strong>Viajes de Servicios </strong></td>
<td ><strong>% Cumpl Transp. </strong></td>
</tr>

<tr > <td style="border-top:0;"></td>
<td><strong>Solicitados </strong></td>
<td><strong>Susp/Transp </strong></td>
<td><strong>Susp/Área </strong></td>

<td><strong>Solicitados </strong></td>
<td><strong>Susp/Transp </strong></td>
<td><strong>Susp/Área </strong></td>

<td style="border-top:0;"></td>
<td></td>
</tr>
<t t-foreach="resumen_viajes._get_Solicitudes()" t-as="centro_name">
<tr colspan="2"><td > <div style="font-size:14pt;margin-bottom:5pt;" ><t t-esc="centro_name"/></div></td>


<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_SolicitudesP(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Transporte_Plan(centro_name)"/></div></td>
<td > <div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Area_Plan(centro_name)"/></div></td>


<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_SolicitudesI(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._getTotal_Suspendidos_Transporte_Im(centro_name)"/></div></td>
<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._getTotal_Suspendidos_Area_Im(centro_name)"/></div></td>

<td > <div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_Total_Solici_Serv(centro_name)"/></div></td>

<td ><div style="font-size:14pt;" ><t t-esc="resumen_viajes._get_porciento(centro_name)"/></div></td>


</tr>
<tr>
</tr>
</t>
<tr>
<td><strong>Total</strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_SolicitudesP()" /></strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_Transporte_Plan()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._get_TotalFinal_Area_Plan()" /></strong></td>
<td><strong><t t-esc="resumen_viajes._get_Total_Final_SolicitudesI()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._getTotal_Final_Suspendidos_Transporte_Im()"/></strong></td>
<td><strong><t t-esc="resumen_viajes._getTotal_Final_Suspendidos_Area_Im()"/></strong></td>
<td ><strong><t t-esc="resumen_viajes._get_Total_Final_Solici_Serv()"/> </strong></td>
<td ><strong><t t-esc="resumen_viajes._get_Total_porciento()"/></strong></td>
</tr>

</table>
</td>
</tr>
</table>
</div>
</div>
</t>
</t>
</t>
</template>

</odoo>
my class py
class FlotaSolicitudResumenViajes(models.TransientModel):
_name = 'flota.resumen.viajes'

anno = fields.Char(string="Año", default=datetime.now().year, size=4)
mes = fields.Selection([
('1', 'Enero'),
('2', 'Febrero'),
('3', 'Marzo'),
('4', 'Abril'),
('5', 'Mayo'),
('6', 'Junio'),
('7', 'Julio'),
('8', 'Agosto'),
('9', 'Septiembre'),
('10', 'Octubre'),
('11', 'Noviembre'),
('12', 'Diciembre')
], string='Mes', default=str(datetime.now().month))
def print_report(self):
return self.env.ref('flota.action_resumen_report').report_action(self)
# RESUMEN DE VIAJES
@api.depends('anno', 'mes')
def _get_Solicitudes(self):
centros_costo = []
for record in self:
sql_query = """Select centro_name from flota_solicitud where mes = """ + repr(
record.mes) + " and anno = " + repr(record.anno) + " group by centro_name "
self.env.cr.execute(sql_query, (record.id,))
for c in self.env.cr.dictfetchall():
centros_costo.append(c.get('centro_name'),
)

return centros_costo

def _get_Total_Final_SolicitudesP(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'planificado')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_SolicitudesP(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'planificado')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Area_Plan(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'planificado'),
('causa', '=', 'area')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_TotalFinal_Area_Plan(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'planificado'),
('causa', '=', 'area')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Transporte_Plan(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'planificado'),
('causa', '=', 'transporte')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Final_Transporte_Plan(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'planificado'),
('causa', '=', 'transporte')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Solici_Serv(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'servicios'),
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Final_Solici_Serv(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'servicios'),
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_SolicitudesI(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'imprevisto')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_Total_Final_SolicitudesI(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'imprevisto')
])
for a in flota_solicitudes:
total = total + 1
return total

def _getTotal_Suspendidos_Area_Im(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'imprevisto'),
('causa', '=', 'area')
])
for a in flota_solicitudes:
total = total + 1
return total

def _getTotal_Final_Suspendidos_Area_Im(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'imprevisto'),
('causa', '=', 'area')
])
for a in flota_solicitudes:
total = total + 1
return total

def _getTotal_Suspendidos_Transporte_Im(self, centro_name):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('centro_name', '=', centro_name),
('tipo_viaje', '=', 'imprevisto'),
('causa', '=', 'transporte')
])
for a in flota_solicitudes:
total = total + 1
return total

def _getTotal_Final_Suspendidos_Transporte_Im(self):
total = 0
flota_solicitudes = self.env['flota.solicitud']
for record in self:
flota_solicitudes = flota_solicitudes | self.env['flota.solicitud'].search([
('anno', '=', record.anno),
('mes', '=', record.mes),
('tipo_viaje', '=', 'imprevisto'),
('causa', '=', 'transporte')
])
for a in flota_solicitudes:
total = total + 1
return total

def _get_porciento(self, centro_name):
total = 0
total_transporte = 0
causa = 'transporte'
porciento_cumplimiento = 100

for record in self:
self._cr.execute("""Select * from flota_solicitud where mes = """ +
repr(record.mes) + " and anno = " + repr(record.anno) +
" and centro_name = " + repr(centro_name))
data_total = self._cr.dictfetchall()
for a in data_total:
total += 1
self._cr.execute("""Select * from flota_solicitud where mes = """ +
repr(record.mes) + " and anno = " + repr(record.anno) +
"and causa = " + repr(causa) +
" and centro_name = " + repr(centro_name))
data_total_t = self._cr.dictfetchall()
for a in data_total_t:
total_transporte += 1
if total_transporte != 0:
porciento_cumplimiento = (total - total_transporte) / total * 100

return round(porciento_cumplimiento, 2)

def _get_Total_porciento(self):
total = 0
total_transporte = 0
causa = 'transporte'
porciento_cumplimiento = 100

for record in self:
self._cr.execute("""Select * from flota_solicitud where mes = """ +
repr(record.mes) + " and anno = " + repr(record.anno))
data_total = self._cr.dictfetchall()
for a in data_total:
total += 1
self._cr.execute("""Select * from flota_solicitud where mes = """ +
repr(record.mes) + " and anno = " + repr(record.anno) +
"and causa = " + repr(causa))
data_total_t = self._cr.dictfetchall()
for a in data_total_t:
total_transporte += 1
if total_transporte != 0:
porciento_cumplimiento = (total - total_transporte) / total * 100

return round(porciento_cumplimiento, 2)




My views
<!--REPORTE PDF-->
<record model="ir.ui.view" id="solicitud_resumen_form">
<field
name="name">flota.resumen.viajes.wizard</field>
<field
name="model">flota.resumen.viajes</field>
<field
name="arch" type="xml">
<form
string="Resumen de viajes" >
<group >
<field
name="anno" />
<field
name="mes" />
</group>
<footer>
<button
name="print_report" string="Generar" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="btn btn-secondary" special="cancel" />
</footer>
</form>
</field>
</record>

<act_window
id="action_flota_resumen_viaje"
name="Resumen de viajes PDF"
res_model="flota.resumen.viajes"
binding_model="flota.solicitud"
binding_type="report"
view_mode="form" target="new" />

thanks a lot for your cooperation!!!
0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Change PDF report name on wizard
wizard report
Avatar
Avatar
2
जुल॰ 24
4066
Blank report PDF from Wizard Solved
wizard report
Avatar
Avatar
2
अप्रैल 24
3606
How to print report without closing wizard?
wizard report
Avatar
Avatar
1
मार्च 15
6064
How to generate a report from a wizard?
wizard reporting report
Avatar
Avatar
1
अप्रैल 24
33076
Close wizard after print report Solved
wizard report odooV8
Avatar
Avatar
Avatar
Avatar
3
फ़र॰ 24
13510
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now