diff --git a/addons/account_check_printing/models/account_payment.py b/addons/account_check_printing/models/account_payment.py index 5423d1c7af9..eeb098c2f45 100644 --- a/addons/account_check_printing/models/account_payment.py +++ b/addons/account_check_printing/models/account_payment.py @@ -110,7 +110,7 @@ class AccountPayment(models.Model): def do_print_checks(self): check_layout = self[0].company_id.account_check_printing_layout - if check_layout == 'disabled': + if not check_layout or check_layout == 'disabled': raise UserError(_("You have to choose a check layout. For this, go in Invoicing/Accounting Settings, search for 'Checks layout' and set one.")) report_action = self.env.ref(check_layout, False) if not report_action: @@ -118,7 +118,6 @@ class AccountPayment(models.Model): self.write({'state': 'sent'}) return report_action.report_action(self) - def set_check_amount_in_words(self): for payment in self: payment.check_amount_in_words = payment.currency_id.amount_to_text(payment.amount) if payment.currency_id else '' diff --git a/addons/account_check_printing/models/res_company.py b/addons/account_check_printing/models/res_company.py index bf6c584ae06..45d22854d88 100644 --- a/addons/account_check_printing/models/res_company.py +++ b/addons/account_check_printing/models/res_company.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- -from odoo import models, api, fields +from odoo import models, fields + class res_company(models.Model): _inherit = "res.company" # This field needs to be overridden with `selection_add` in the modules which intends to add report layouts. # The xmlID of all the report actions which are actually Check Layouts has to be kept as key of the selection. - account_check_printing_layout = fields.Selection(string="Check Layout", required=True, + account_check_printing_layout = fields.Selection(string="Check Layout", help="Select the format corresponding to the check paper you will be printing your checks on.\n" "In order to disable the printing feature, select 'None'.", selection=[ diff --git a/addons/account_check_printing/views/res_config_settings_views.xml b/addons/account_check_printing/views/res_config_settings_views.xml index ef5e5f8f8c6..e3325ae3c84 100644 --- a/addons/account_check_printing/views/res_config_settings_views.xml +++ b/addons/account_check_printing/views/res_config_settings_views.xml @@ -9,7 +9,7 @@