|
|
@ -1,7 +1,8 @@ |
|
|
|
# Copyright 2019 Druidoo - Iván Todorovich |
|
|
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). |
|
|
|
|
|
|
|
from odoo import models, fields |
|
|
|
from odoo import api, models, fields, _ |
|
|
|
from odoo.exceptions import ValidationError |
|
|
|
|
|
|
|
|
|
|
|
class PosConfig(models.Model): |
|
|
@ -19,3 +20,9 @@ class PosConfig(models.Model): |
|
|
|
default=lambda self: |
|
|
|
self.env.ref('account.email_template_edi_invoice', False), |
|
|
|
) |
|
|
|
|
|
|
|
@api.constrains('iface_invoice_mail', 'invoice_mail_template_id') |
|
|
|
def _check_invoice_mail_templat_id(self): |
|
|
|
for rec in self.filtered('iface_invoice_mail'): |
|
|
|
if not rec.invoice_mail_template_id: |
|
|
|
raise ValidationError(_('Invoice Email Template is required')) |