account_analytic_invoice_line.py 872 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. def get_contract_line_inmobiliaria():
  4. query = '''
  5. SELECT
  6. line.id,
  7. line.analytic_account_id,
  8. line.name,
  9. line.quantity,
  10. line.price_unit,
  11. tmp.t_manzana,
  12. tmp.t_lote,
  13. tmp.t_nro,
  14. tmp.t_propietario
  15. FROM account_analytic_invoice_line AS line
  16. LEFT JOIN product_product AS product
  17. ON line.product_id = product.id
  18. LEFT JOIN product_template AS tmp
  19. ON product.product_tmpl_id = tmp.id
  20. '''
  21. r.cr.execute(query)
  22. return [
  23. {
  24. 'id': j[0],
  25. 'analytic_account_id': j[1],
  26. 'name': j[2],
  27. 'quantity': j[3],
  28. 'price_unit': j[4],
  29. 't_manzana': j[5],
  30. 't_lote': j[6],
  31. 't_nro': j[7],
  32. 't_propietario':j[8],
  33. } for j in r.cr.fetchall()
  34. ]