You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
711 B

  1. # SDI
  2. # © 2018 David Juaneda <djuaneda@sdi.es>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import api, fields, models
  5. class Partner(models.Model):
  6. _inherit = 'res.partner'
  7. contact_origin = fields.Many2one('res.partner', string='Contact origin')
  8. @api.multi
  9. def open_commercial_partner(self):
  10. """
  11. It redirects us to the contact form view.
  12. """
  13. self.ensure_one()
  14. return {'type': 'ir.actions.act_window',
  15. 'res_model': 'res.partner',
  16. 'view_mode': 'form',
  17. 'res_id': self.id,
  18. 'target': 'current',
  19. 'flags': {'form': {'action_buttons': False}}}