1234567891011121314151617181920212223242526272829303132333435 |
- # -*- coding: utf-8 -*-
- from openerp import models, fields, api
- class ProductProduct(models.Model):
- _inherit = 'product.product'
- @api.model
- def getProductProductStockAthletic(self,domain):
- ProductProduct = self.env['product.product'].search(domain)
- values = []
- for product in ProductProduct:
- attributeValuesLines = map(lambda x: x.id, product.attribute_value_ids)
- attributeIDS = []
- for arttIds in self.env['product.attribute.value'].search([('id', 'in', attributeValuesLines)]):
- attributeIDS.append(arttIds.attribute_id.id)
- values.append({
- 'id': product.id,
- 'display_name': product.display_name,
- 'standard_price': product.standard_price,
- 'lst_price': product.lst_price,
- 'categ_id': {
- 'id': product.categ_id.id,
- 'name': product.categ_id.name,
- 'complete_name': product.categ_id.complete_name,
- },
- 'atribute_value_ids': attributeValuesLines,
- 'attribute_ids': attributeIDS,
- 'default_code': product.default_code,
- 'factory_reference': product.factory_reference,
- 'ean13': product.ean13,
- })
- return values
|