models.py 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class RepairConfigorder(models.Model):
  4. _inherit = 'repair.configorderimproved'
  5. @api.model
  6. def getRepairConfigorder(self,domain):
  7. RepairConfigorder = self.env['repair.configorderimproved'].search(domain)
  8. values = []
  9. for configorder in RepairConfigorder:
  10. try:
  11. street = configorder.partner_id.street
  12. except Exception as e:
  13. street = ''
  14. values.append({
  15. # ID
  16. 'id': configorder.id,
  17. # ConfigORDER INFO
  18. 'name': configorder.name or "",
  19. 'user_name': configorder.user_id.name or "",
  20. 'user_dos': configorder.user_dos or "",
  21. 'planned_date': configorder.planned_date or "",
  22. 'pedido_obra': configorder.pedido_obra or "",
  23. 'name_obra': configorder.name_obra or "",
  24. 'order_date': configorder.order_date or "",
  25. 'ref_fact': configorder.ref_fact or "",
  26. 'movil': configorder.movil or "",
  27. 'brand_eq': configorder.brand_eq or "",
  28. 'gas_eq': configorder.gas_eq or "",
  29. 'turb_eq': configorder.turb_eq or "",
  30. 'model_eq': configorder.model_eq or "",
  31. 'carga_eq': configorder.carga_eq or "",
  32. 'capacitor_eq': configorder.capacitor_eq or "",
  33. 'serie_eq': configorder.serie_eq or "",
  34. 'tension_eq': configorder.tension_eq or "",
  35. 'largo_eq': configorder.largo_eq or "",
  36. 'capacidad_eq': configorder.capacidad_eq or "",
  37. 'presion_ini_eq': configorder.presion_ini_eq or "",
  38. 'presion_fin_eq': configorder.presion_fin_eq or "",
  39. 'estado_eq': configorder.estado_eq or "",
  40. 'trabajo_eq': configorder.trabajo_eq or "",
  41. 'mante_eq': configorder.mante_eq or "",
  42. 'garan_eq': configorder.garan_eq or "",
  43. 'ficha_eq': configorder.ficha_eq or "",
  44. 'lacre_eq': configorder.lacre_eq or "",
  45. 'tablero': configorder.tablero or "",
  46. 'disyuntor_tab': configorder.disyuntor_tab or "",
  47. 'tension_tab': configorder.tension_tab or "",
  48. 'tensions_tab': configorder.tensions_tab or "",
  49. 'cargar_tab': configorder.cargar_tab or "",
  50. 'limitador_tab': configorder.limitador_tab or "",
  51. 'serie_tab': configorder.serie_tab or "",
  52. 'cargas_tab': configorder.cargas_tab or "",
  53. 'tensiont_tab': configorder.tensiont_tab or "",
  54. 'disyuntor2_tab': configorder.disyuntor2_tab or "",
  55. 'cargat_tab': configorder.cargat_tab or "",
  56. 'potencia_tab': configorder.potencia_tab or "",
  57. 'estado_tab': configorder.estado_tab or "",
  58. 'trabajo_tab': configorder.trabajo_tab or "",
  59. 'mante_tab': configorder.mante_tab or "",
  60. 'garan_tab': configorder.garan_tab or "",
  61. 'ficha_tab': configorder.ficha_tab or "",
  62. 'lacre_tab': configorder.lacre_tab or "",
  63. 'equipo_tel': configorder.equipo_tel or "",
  64. 'capacidad_tel': configorder.capacidad_tel or "",
  65. 'tension_tel': configorder.tension_tel or "",
  66. 'contrasena_tel': configorder.contrasena_tel or "",
  67. 'dns_tel': configorder.dns_tel or "",
  68. 'port_tel': configorder.port_tel or "",
  69. 'brand_tel': configorder.brand_tel or "",
  70. 'portact_tel': configorder.portact_tel or "",
  71. 'ip_tel': configorder.ip_tel or "",
  72. 'dnsalt_tel': configorder.dnsalt_tel or "",
  73. 'host_tel': configorder.host_tel or "",
  74. 'model_tel': configorder.model_tel or "",
  75. 'zonas_tel': configorder.zonas_tel or "",
  76. 'mac_tel': configorder.mac_tel or "",
  77. 'correo_tel': configorder.correo_tel or "",
  78. 'ippub_tel': configorder.ippub_tel or "",
  79. 'serie_tel': configorder.serie_tel or "",
  80. 'usuario_tel': configorder.usuario_tel or "",
  81. 'iprouter_tel': configorder.iprouter_tel or "",
  82. 'contrasena2_tel': configorder.contrasena2_tel or "",
  83. 'contrdeco_tel': configorder.contrdeco_tel or "",
  84. 'estado_tel': configorder.estado_tel or "",
  85. 'trabajo_tel': configorder.trabajo_tel or "",
  86. 'mante_tel': configorder.mante_tel or "",
  87. 'garan_tel': configorder.garan_tel or "",
  88. 'ficha_tel': configorder.ficha_tel or "",
  89. 'lacre_tel': configorder.lacre_tel or "",
  90. # PARTNER INFO
  91. 'partner_id': configorder.partner_id.id or "",
  92. 'partner_name': configorder.partner_id.name or "",
  93. 'partner_ruc': configorder.partner_id.ruc or "",
  94. 'partner_address': street or "",
  95. 'partner_phone': configorder.partner_id.phone or "",
  96. 'partner_mobile': configorder.partner_id.mobile or "",
  97. # COMPANY INFO
  98. 'company_id': configorder.user_id.company_id.id or "",
  99. 'company_name': configorder.user_id.company_id.name or "",
  100. 'company_logo': configorder.user_id.company_id.logo or "",
  101. 'company_address': configorder.user_id.company_id.street2 or "",
  102. 'company_phone': configorder.user_id.company_id.phone or "",
  103. })
  104. return values