|
|
@ -1,5 +1,5 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
from openerp import models, fields, api |
|
|
|
from openerp import models, fields, api, _ |
|
|
|
|
|
|
|
class BeesPOS(models.Model): |
|
|
|
_inherit = 'pos.config' |
|
|
@ -32,8 +32,10 @@ class BeescoopPosOrder(models.Model): |
|
|
|
@api.model |
|
|
|
def send_order(self, receipt_name): |
|
|
|
order = self.search([('pos_reference', '=', receipt_name)]) |
|
|
|
if not order: |
|
|
|
return _('Error: no order found') |
|
|
|
if not order.partner_id.email: |
|
|
|
return False |
|
|
|
return _('Cannot send the ticket, no email address found on the client') |
|
|
|
mail_template = self.env.ref("beescoop_pos.email_send_ticket") |
|
|
|
mail_template.send_mail(order.id) |
|
|
|
return True |
|
|
|
return _("Ticket sent") |