123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- # -*- coding: utf-8 -*-
- from openerp.http import request as r
- def get_product_template_inmobiliaria():
- query = '''
- SELECT
- tpt.id,
- tpt.name,
- tpt.type,
- tpt.comision_vendedor,
- tpt.comision_inmobiliaria,
- tpt.comision_total,
- tpt.t_propietario,
- partner.name,
- tpt.t_tamanho,
- tpt.t_direccion,
- tpt.t_descripcion,
- tpt.list_price,
- tpt.categ_id,
- tpt.t_estado,
- estado.name,
- tpt.t_nro,
- tpt.comision_propietario
- FROM product_template AS tpt
- LEFT JOIN res_partner AS partner
- ON partner.id = tpt.t_propietario
- LEFT JOIN property_state AS estado
- ON estado.id = tpt.t_estado
- WHERE tpt.active = true AND tpt.sale_ok = true
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- 'type': j[2],
- 'comision_vendedor': j[3],
- 'comision_inmobiliaria.': j[4],
- 'comision_total': j[5],
- 'propietario_id': j[6],
- 'propietario_name': j[7],
- 'tamanho': j[8],
- 'direccion': j[9],
- 'descripcion': j[10],
- 'precio': j[11],
- 'categoria': j[12],
- 'estado_id': j[13],
- 'estado_name': j[14],
- 't_nro': j[15],
- 'comision_propietario': j[16],
- } for j in r.cr.fetchall()
- ]
- def get_property_state_inmobiliaria():
- query = '''
- SELECT
- state.id,
- state.name
- FROM property_state AS state
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- } for j in r.cr.fetchall()
- ]
|