123456789101112131415161718192021222324252627282930313233343536 |
- # -*- coding: utf-8 -*-
- from openerp import models, fields, api
- class ProductPriceList(models.Model):
- _inherit = 'product.pricelist'
- @api.model
- def getProductPriceList(self,domain):
- ProductPriceList = self.env['product.pricelist'].search(domain)
- values = []
- for pricelist in ProductPriceList:
- version_ids = map(lambda x: x.id, pricelist.version_id)
- versionIDS = []
- for item in self.env['product.pricelist'].search([('id', 'in', version_ids)]):
- versionIDS.append(item.id)
- values.append({
- 'id' : pricelist.id,
- 'name' : pricelist.name,
- 'type' : pricelist.type,
- 'version_id' : versionIDS,
- 'store_id' : {
- 'id' : pricelist.store_id.id,
- 'name' : pricelist.store_id.name,
- },
- 'currency_id' : {
- 'id' : pricelist.currency_id.id,
- 'name' : pricelist.currency_id.name,
- 'rate_silent': pricelist.currency_id.rate_silent,
- 'local_name':pricelist.currency_id.local_name
- },
- })
- return values
|