sale_commission.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # -*- coding: utf-8 -*-
  2. from openerp import api, exceptions, fields, models, _
  3. class SaleCommission(models.Model):
  4. _name = "sale.commission"
  5. _description = "Commission in sales"
  6. @api.model
  7. def _get_default_company_id(self):
  8. company_obj = self.env['res.company']
  9. company_id = company_obj._company_default_get('sale.commission')
  10. return company_obj.browse(company_id)
  11. name = fields.Char('Name', required=True)
  12. commission_type = fields.Selection(
  13. selection = [
  14. ("fixed", "Fixed percentage")
  15. ],
  16. string="Type",
  17. required=True, default="fixed")
  18. fix_qty = fields.Float(string="Fixed percentage")
  19. active = fields.Boolean(default=True)
  20. invoice_state = fields.Selection(
  21. selection = [
  22. ('open', 'Facturas Abiertas'),
  23. ('paid', 'Facturas Pagadas'),
  24. ],
  25. string='Invoice Status',
  26. required=True, default='open')
  27. amount_base_type = fields.Selection(
  28. selection = [
  29. ('utility_amount', 'Utilidad'),
  30. ('gross_amount', 'Monto Bruto'),
  31. ('net_amount', 'Monto Neto'),
  32. ],
  33. string='Base',
  34. required=True, default='utility_amount')
  35. company_id = fields.Many2one('res.company', string='Company',
  36. default=_get_default_company_id)