summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/wizard
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-07-14 15:51:59 +0200
committerChristophe Simonis <chs@odoo.com>2017-07-14 15:51:59 +0200
commitdb2f82d5f1a8c4fdbbd61a0aa7daef2def0ef06e (patch)
tree4dd6a0d816180b06963a245d01a817ebcdaf7868 /addons/point_of_sale/wizard
parent55d72e1ab4a64f52e040911a8b4b4c8ce9443f65 (diff)
parent4ca3d9cadf9607c95880bb5222041bced7b13ec0 (diff)
[MERGE] forward port branch saas-16 up to 4ca3d9cadf9
Diffstat (limited to 'addons/point_of_sale/wizard')
-rw-r--r--addons/point_of_sale/wizard/pos_details.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/point_of_sale/wizard/pos_details.py b/addons/point_of_sale/wizard/pos_details.py
index c4691daec3a..1e8fed01a25 100644
--- a/addons/point_of_sale/wizard/pos_details.py
+++ b/addons/point_of_sale/wizard/pos_details.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from odoo import api, fields, models
+from odoo import api, fields, models, _
from odoo.exceptions import UserError
@@ -44,5 +44,9 @@ class PosDetails(models.TransientModel):
@api.multi
def generate_report(self):
+ if (not self.env.user.company_id.logo):
+ raise UserError(_("You have to set a logo or a layout for your company."))
+ elif (not self.env.user.company_id.external_report_layout):
+ raise UserError(_("You have to set your reports's header and footer layout."))
data = {'date_start': self.start_date, 'date_stop': self.end_date, 'config_ids': self.pos_config_ids.ids}
return self.env.ref('point_of_sale.sale_details_report').report_action([], data=data)