project_service.py 538 B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. from openerp import models, fields, api
  3. from openerp.exceptions import except_orm, Warning, RedirectWarning
  4. class ProjectServiceCarWorkShop(models.Model):
  5. _inherit = 'project.service'
  6. agent_id = fields.Many2one('res.partner', string='Agente de Seguro')
  7. policy = fields.Boolean(string="Policy")
  8. @api.one
  9. @api.onchange('name')
  10. def onchange_name(self):
  11. self.partner_id = self.name.partner_id.id
  12. self.agent_id = self.name.agent_id.id
  13. self.policy = self.name.policy