commission_by_seller.py 618 B

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