12345678910111213141516171819202122232425262728293031323334353637383940 |
- # -*- coding: utf-8 -*-
- from openerp import api, exceptions, fields, models, _
- class SaleCommission(models.Model):
- _name = "sale.commission"
- _description = "Commission in sales"
- @api.model
- def _get_default_company_id(self):
- company_obj = self.env['res.company']
- company_id = company_obj._company_default_get('sale.commission')
- return company_obj.browse(company_id)
- name = fields.Char('Name', required=True)
- commission_type = fields.Selection(
- selection = [
- ("fixed", "Fixed percentage")
- ],
- string="Type",
- required=True, default="fixed")
- fix_qty = fields.Float(string="Fixed percentage")
- active = fields.Boolean(default=True)
- invoice_state = fields.Selection(
- selection = [
- ('open', 'Facturas Abiertas'),
- ('paid', 'Facturas Pagadas'),
- ],
- string='Invoice Status',
- required=True, default='open')
- amount_base_type = fields.Selection(
- selection = [
- ('utility_amount', 'Utilidad'),
- ('gross_amount', 'Monto Bruto'),
- ('net_amount', 'Monto Neto'),
- ],
- string='Base',
- required=True, default='utility_amount')
- company_id = fields.Many2one('res.company', string='Company',
- default=_get_default_company_id)
|