123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- # -*- coding: utf-8 -*-
- from openerp import models, fields, api
- class PosSession(models.Model):
- _inherit = 'pos.session'
- @api.model
- def getPosSession(self,domain):
- PosSession = self.env['pos.session'].search(domain)
- values = []
- for session in PosSession:
- values.append({
- 'id': session.id,
- 'name': session.name,
- 'user_id':[
- session.user_id.id,
- session.user_id.name,
- ],
- 'config_id':[
- session.config_id.id,
- session.config_id.name,
- ],
- 'start_at': session.start_at,
- 'stop_at': session.stop_at,
- 'state': session.state,
- })
- return values
- class PosConfig(models.Model):
- _inherit = 'pos.config'
- @api.model
- def getPosConfig(self,domain):
- PosConfig = self.env['pos.config'].search(domain)
- values = []
- for config in PosConfig:
- values.append({
- 'id': config.id,
- 'name': config.name,
- 'journal_id':[
- config.journal_id.id,
- config.journal_id.name,
- ],
- })
- return values
- class PosCategory(models.Model):
- _inherit = 'pos.category'
- @api.model
- def getPosCategory(self,domain):
- PorCategory = self.env['pos.category'].search(domain)
- values = []
- for category in PorCategory:
- values.append({
- 'id': category.id,
- 'complete_name': category.complete_name,
- })
- return values
|