Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

External ID not found in the system

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
wizardreport
4 Replies
6677 Rodiniai
Portretas
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
Portretas
Atmesti
Sudhir Arya (ERP Harbor Consulting Services)

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

Dunia
Autorius

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?

Portretas
Dunia
Autorius 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
Portretas
Atmesti
Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
Change PDF report name on wizard
wizard report
Portretas
Portretas
2
liep. 24
4244
Blank report PDF from Wizard Solved
wizard report
Portretas
Portretas
2
bal. 24
3745
How to print report without closing wizard?
wizard report
Portretas
Portretas
1
kov. 15
6182
How to generate a report from a wizard?
wizard reporting report
Portretas
Portretas
1
bal. 24
33250
Close wizard after print report Solved
wizard report odooV8
Portretas
Portretas
Portretas
Portretas
3
vas. 24
13623
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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