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.

25 lines
718 B

7 years ago
  1. # coding: utf-8
  2. # Copyright 2017 Akretion (http://www.akretion.com).
  3. # @author Raphaël Reverdy <raphael.reverdy@akretion.com>
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. from openerp import models, api
  6. class Partner(models.Model):
  7. _inherit = "res.partner"
  8. @api.multi
  9. def select_in_pos_current_order(self):
  10. """Set point of sale customer to this partner.
  11. Action called from view with self.id = a res.partner.
  12. """
  13. return {
  14. 'type': 'ir.actions.act_tell_pos',
  15. 'payload': {
  16. 'type': 'partner.partner_selected',
  17. 'partner_id': self.id,
  18. 'name': self.name,
  19. },
  20. }