Skip to content

Commit

Permalink
[IMP] website_sale_product_document: minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KNVx committed Oct 26, 2023
1 parent 79caee2 commit a56040c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions website_sale_product_document/models/product_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def _compute_attachment_id(self):
)
if not attachment:
raise ValidationError(_("No attachment found"))

Check warning on line 40 in website_sale_product_document/models/product_document.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_document/models/product_document.py#L40

Added line #L40 was not covered by tests
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]

Check warning on line 43 in website_sale_product_document/models/product_document.py

View check run for this annotation

Codecov / codecov/patch

website_sale_product_document/models/product_document.py#L42-L43

Added lines #L42 - L43 were not covered by tests
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright NuoBiT Solutions - Kilian Niubo <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -->
<!--TODO: REVIEW: This view and product_product_views in this module are equivalent.
Try to unify them https://www.odoo.com/documentation/14.0/developer/reference/addons/views.html#inheritance-fields-->
<odoo>
<record
id="website_sale_public_description_product_template_view_form"
Expand All @@ -17,7 +19,7 @@
<field name="sequence" widget="handle" />
<field name="name" />
<field name="datas" filename="datas_fname" />
<field name="datas_fname" />
<field name="datas_fname" />
</tree>
</field>
</group>
Expand Down

0 comments on commit a56040c

Please sign in to comment.