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.

21 lines
625 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, models
  5. class Partner(models.Model):
  6. _inherit = 'res.partner'
  7. @api.multi
  8. def open_commercial_partner(self):
  9. """
  10. It redirects us to the contact form view.
  11. """
  12. self.ensure_one()
  13. return {'type': 'ir.actions.act_window',
  14. 'res_model': 'res.partner',
  15. 'view_mode': 'form',
  16. 'res_id': self.id,
  17. 'target': 'current',
  18. 'flags': {'form': {'action_buttons': False}}}