product_pack.py 499 B

123456789101112131415161718
  1. # -*- coding: utf-8 -*-
  2. from openerp.http import request as r
  3. _MODEL = 'product.pack.line'
  4. def get_product_packs():
  5. return [
  6. {
  7. 'id': p.id,
  8. 'name': p.display_name,
  9. 'parentProduct': p.parent_product_id.id or None,
  10. 'productId': p.product_id.id or None,
  11. 'price': p.price,
  12. 'quantity': p.quantity,
  13. 'subtotal': p.subtotal,
  14. 'discount': p.discount
  15. } for p in r.env[_MODEL].search([])
  16. ]