# -*- coding: utf-8 -*- from openerp import models, fields, api class DashboardObjective(models.Model): _name = 'salesman.commission' sale_type = fields.Selection([ ('credito', 'Crédito'), ('contado', 'Contado')], string='Tipo de Venta') sale_commission = fields.Float(string="Comisión de Ventas (Porcentaje)") @api.onchange('user_id') def onchange_user_id(self): res = {} user = self.env['res.users'].search([('id','=', self.user_id.id)]) self.store_id = user.store_id.id res = {'value' :{'store_id': self.store_id}} return res