1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- # -*- coding: utf-8 -*-
- from openerp.http import request as r
- def get_res_partner_inmobiliaria():
- query = '''
- SELECT
- partner.id,
- partner.name,
- partner.ruc
- FROM res_partner AS partner
- WHERE partner.customer = True AND partner.active = True
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- 'ruc': j[2],
- } for j in r.cr.fetchall()
- ]
- def get_all_res_partner_inmobiliaria():
- query = '''
- SELECT
- partner.id,
- partner.name,
- partner.ruc
- FROM res_partner AS partner
- WHERE partner.active = True
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- 'ruc': j[2],
- } for j in r.cr.fetchall()
- ]
- def get_supplier_inmobiliaria():
- query = '''
- SELECT
- partner.id,
- partner.name,
- partner.ruc
- FROM res_partner AS partner
- WHERE partner.supplier = true AND partner.active = true
- '''
- r.cr.execute(query)
- return [
- {
- 'id': j[0],
- 'name': j[1],
- 'ruc': j[2],
- } for j in r.cr.fetchall()
- ]
|