Skip to content

Commit 730f3c5

Browse files
committed
[IMP] website_sale_product_document: minor refactor
1 parent 41fd8e8 commit 730f3c5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

website_sale_product_document/models/product_document.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def _compute_attachment_id(self):
3838
)
3939
if not attachment:
4040
raise ValidationError(_("No attachment found"))
41-
elif len(attachment) > 1:
41+
if len(attachment) > 1:
4242
raise ValidationError(_("More than one attachment found"))
43-
else:
44-
rec.attachment_id = attachment[0]
43+
rec.attachment_id = attachment[0]

website_sale_product_document/views/product_template_views.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<!-- Copyright NuoBiT Solutions - Kilian Niubo <[email protected]>
33
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -->
4+
<!--TODO: REVIEW: This view and product_product_views in this module are equivalent.
5+
Try to unify them https://www.odoo.com/documentation/14.0/developer/reference/addons/views.html#inheritance-fields-->
46
<odoo>
57
<record
68
id="website_sale_public_description_product_template_view_form"
@@ -17,7 +19,7 @@
1719
<field name="sequence" widget="handle" />
1820
<field name="name" />
1921
<field name="datas" filename="datas_fname" />
20-
<field name="datas_fname" />
22+
<field name="datas_fname" />
2123
</tree>
2224
</field>
2325
</group>

0 commit comments

Comments
 (0)