123456789101112131415161718192021222324 |
- # -*- coding: utf-8 -*-
- from openerp import api, fields, models
- class ResPartner(models.Model):
- """Add some fields related to commissions"""
- _inherit = "res.partner"
- agents = fields.Many2many(
- comodel_name="res.partner", relation="partner_agent_rel",
- column1="partner_id", column2="agent_id",
- domain="[('agent', '=', True)]")
- agent = fields.Boolean(
- string="Creditor/Agent",
- help="Check this field if the partner is a creditor or an agent.")
- agent_type = fields.Selection(
- selection=[("agent", "Agente")], string="Type", required=True,
- default="agent")
- commission = fields.Many2one(
- string="Commission", comodel_name="sale.commission",
- help="This is the default commission used in the sales where this "
- "agent is assigned. It can be changed on each operation if "
- "needed.")
|