product.py 618 B

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. class ProductProduct(models.Model):
  4. _inherit = 'product.product'
  5. ############################################################
  6. # PRODUCT PRODUCT
  7. ############################################################
  8. @api.model
  9. def getProductProductSearch(self,domain):
  10. ProductProduct = self.env['product.product'].search(domain)
  11. values = []
  12. for product in ProductProduct:
  13. values.append({
  14. 'id': product.id,
  15. 'display_name': product.display_name,
  16. 'ean13': product.ean13,
  17. 'default_code': product.default_code,
  18. })
  19. return values