Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

External ID not found in the system

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
wizardreport
4 Trả lời
6662 Lượt xem
Ảnh đại diện
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
Ảnh đại diện
Huỷ bỏ
Sudhir Arya (ERP Harbor Consulting Services)

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

Dunia
Tác giả

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?

Ảnh đại diện
Dunia
Tác giả Câu trả lời hay nhấ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
Ảnh đại diện
Huỷ bỏ
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
Change PDF report name on wizard
wizard report
Ảnh đại diện
Ảnh đại diện
2
thg 7 24
4232
Blank report PDF from Wizard Đã xử lý
wizard report
Ảnh đại diện
Ảnh đại diện
2
thg 4 24
3732
How to print report without closing wizard?
wizard report
Ảnh đại diện
Ảnh đại diện
1
thg 3 15
6176
How to generate a report from a wizard?
wizard reporting report
Ảnh đại diện
Ảnh đại diện
1
thg 4 24
33229
Close wizard after print report Đã xử lý
wizard report odooV8
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
Ảnh đại diện
3
thg 2 24
13613
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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