İçereği Atla
Odoo Menü
  • Portal
  • Ücretsiz deneyin
  • Uygulamalar
    Finans
    • Muhasebe
    • Faturalama
    • Masraf Yönetimi
    • Elektronik Çizelge (BI)
    • Belgeler
    • İmza
    Satış
    • Müşteri İlişkileri Yönetimi (CRM)
    • Satış
    • Satış Noktası Mağaza
    • Satış Noktası Restoran
    • Abonelikler
    • Kiralama
    Web Sitesi
    • Web Sitesi Oluşturucu
    • eTicaret
    • Blog
    • Forum
    • Canlı Sohbet
    • eÖğrenme
    Tedarik Zinciri
    • Envanter
    • Üretim
    • Ürün Yaşam Döngüsü Yönetimi
    • Satın Alma
    • Bakım
    • Kalite
    İnsan Kaynakları
    • Çalışanlar
    • İşe Alım
    • İzin
    • Değerlendirme
    • Referans
    • Filo Yönetimi
    Pazarlama
    • Sosyal Medyada Pazarlama
    • E-posta ile Pazarlama
    • SMS ile Pazarlama
    • Etkinlikler
    • Pazarlama Otomasyonu
    • Anket
    Hizmetler
    • Proje Yönetimi
    • Çalışma Çizelgeleri
    • Saha Hizmeti
    • Yardım Masası
    • Planlama
    • Randevular
    Verimlilik
    • Sohbet
    • Onay
    • Nesnelerin İnterneti
    • VoIP
    • Bilgi Bankası
    • WhatsApp
    Üçüncü taraf uygulamalar Odoo Stüdyo Odoo Bulut Platformu
  • Sektörler
    Perakende satış
    • Kitapçı
    • Giyim Mağazası
    • Mobilya Mağazası
    • Gıda Marketi
    • Hırdavat Dükkanı
    • Oyuncak Dükkanı
    Gıda ve Konaklama
    • Bar ve Pub
    • Restoran
    • Fast Food Restoranı
    • Konuk Evi
    • İçecek Distribütörü
    • Otel
    Gayrimenkul
    • Emlak Acentesi
    • Mimarlık Firması
    • İnşaat
    • Emlak Yönetimi
    • Bahçe Tasarımı
    • Mülk Sahipleri Derneği
    Uzmanlık
    • Muhasebe Firması
    • Odoo Partner
    • Pazarlama Ajansı
    • Hukuk Firması
    • Yetenek Kazanımı
    • Denetim ve Belgelendirme
    Üretim
    • Tekstil
    • Metal
    • Mobilyalar
    • Gıda
    • Bira fabrikası
    • Kurumsal Hediye
    Sağlık ve Spor
    • Spor Kulübü
    • Optik Mağazası
    • Fitness Merkezi
    • Sağlıklı Yaşam Merkezi
    • Eczane
    • Kuaför Salonu
    Ticaret
    • Tamirci
    • BT Donanım & Destek
    • Güneş Enerjisi Sistemleri
    • Ayakkabı İmalatçısı
    • Temizlik Hizmetleri
    • HVAC Hizmetleri
    Diğerleri
    • Kar Amacı Gütmeyen Kuruluş
    • Çevre Ajansı
    • Reklam Panosu Kiralama
    • Fotoğrafçılık
    • Bisiklet Kiralama
    • Yazılım Bayisi
    Tüm Sektörlere Göz Atın
  • Topluluk
    Öğrenim
    • Eğitim Araçları
    • Dokümantasyon
    • Sertifikasyonlar
    • Eğitim Etkinlikleri
    • Blog
    • Podcast
    Eğitim ve Gelişim
    • Eğitim Programı
    • Scale Up! İşletme Oyunu
    • Odoo'yu Ziyaret Edin
    Yazılım
    • İndirin
    • Sürümleri Kıyaslayın
    • Sürümler
    İş Birliği
    • Github
    • Forum
    • Etkinlikler
    • Çeviriler
    • Partner Olun
    • Partnerler için Hizmetler
    • Muhasebe Firmanızı Kaydettirin
    Hizmetler
    • Partner Bulun
    • Muhasebeci Bulun
    • Bir danışmanla görüşün
    • Kurulum Hizmetleri
    • Müşteri Referansları
    • Destek
    • Sürüm Yükseltme
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Demo randevusu alın
  • Fiyatlandırma
  • Yardım

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

  • Müşteri İlişkileri Yönetimi
  • e-Commerce
  • Muhasebe
  • Envanter
  • PoS
  • Proje Yönetimi
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiketler (View all)
odoo accounting v14 pos v15
About this forum
Yardım

External ID not found in the system

Abone Ol

Get notified when there's activity on this post

Bu soru işaretlendi
wizardreport
4 Cevaplar
6610 Görünümler
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
Vazgeç
Sudhir Arya (ERP Harbor Consulting Services)

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

Dunia
Üretici

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
Üretici En İyi Yanıt

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
Vazgeç
Enjoying the discussion? Don't just read, join in!

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

Üye Ol
İlgili Gönderiler Cevaplar Görünümler Aktivite
Change PDF report name on wizard
wizard report
Avatar
Avatar
2
Tem 24
4162
Blank report PDF from Wizard Çözüldü
wizard report
Avatar
Avatar
2
Nis 24
3684
How to print report without closing wizard?
wizard report
Avatar
Avatar
1
Mar 15
6130
How to generate a report from a wizard?
wizard reporting report
Avatar
Avatar
1
Nis 24
33181
Close wizard after print report Çözüldü
wizard report odooV8
Avatar
Avatar
Avatar
Avatar
3
Şub 24
13566
Topluluk
  • Eğitim Araçları
  • Dokümantasyon
  • Forum
Açık Kaynak
  • İndirin
  • Github
  • Runbot
  • Çeviriler
Hizmetler
  • Odoo.sh Hosting
  • Destek
  • Sürüm Yükseltme
  • Özel Geliştirmeler
  • Eğitim
  • Muhasebeci Bulun
  • Partner Bulun
  • Partner Olun
Hakkında
  • Şirketimiz
  • Pazarlama Gereçleri
  • İletişim
  • Kariyer
  • Etkinlikler
  • Podcast
  • Blog
  • Müşteriler
  • Hukuki • Gizlilik
  • Güvenlik
الْعَرَبيّة 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, müşteri ilişkileri yönetimi, eTicaret, muhasebe, envanter, satış noktası, proje yönetimi gibi şirketinizin tüm ihtiyaçlarını karşılayan bir açık kaynak işletme uygulamaları paketidir.

Odoo’nun eşsiz değer önermesi, aynı anda hem kullanımının çok kolay olup hem de tamamen entegre olmasıdır.

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