From 730f3c55760bd1f52229aeafb75c58fcc2710e7d Mon Sep 17 00:00:00 2001 From: KNVx Date: Thu, 26 Oct 2023 17:34:25 +0200 Subject: [PATCH] [IMP] website_sale_product_document: minor refactor --- website_sale_product_document/models/product_document.py | 5 ++--- .../views/product_template_views.xml | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/website_sale_product_document/models/product_document.py b/website_sale_product_document/models/product_document.py index fa3c8ddf7..933853ceb 100644 --- a/website_sale_product_document/models/product_document.py +++ b/website_sale_product_document/models/product_document.py @@ -38,7 +38,6 @@ def _compute_attachment_id(self): ) if not attachment: raise ValidationError(_("No attachment found")) - elif len(attachment) > 1: + if len(attachment) > 1: raise ValidationError(_("More than one attachment found")) - else: - rec.attachment_id = attachment[0] + rec.attachment_id = attachment[0] diff --git a/website_sale_product_document/views/product_template_views.xml b/website_sale_product_document/views/product_template_views.xml index 1e525a60c..2f76ccc9c 100644 --- a/website_sale_product_document/views/product_template_views.xml +++ b/website_sale_product_document/views/product_template_views.xml @@ -1,6 +1,8 @@ + - +