From 20533d3b27ad7429c4fc677a321f1504f0f60ef1 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Fri, 1 Dec 2023 16:14:05 +0700 Subject: add product image in sales and quotation --- sales_report_product_image/tests/__init__.py | 3 ++ .../tests/test_sales_report_product_image.py | 37 ++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 sales_report_product_image/tests/__init__.py create mode 100644 sales_report_product_image/tests/test_sales_report_product_image.py (limited to 'sales_report_product_image/tests') diff --git a/sales_report_product_image/tests/__init__.py b/sales_report_product_image/tests/__init__.py new file mode 100644 index 0000000..86c9c33 --- /dev/null +++ b/sales_report_product_image/tests/__init__.py @@ -0,0 +1,3 @@ +# See LICENSE file for full copyright and licensing details. + +from . import test_sales_report_product_image diff --git a/sales_report_product_image/tests/test_sales_report_product_image.py b/sales_report_product_image/tests/test_sales_report_product_image.py new file mode 100644 index 0000000..b5e24af --- /dev/null +++ b/sales_report_product_image/tests/test_sales_report_product_image.py @@ -0,0 +1,37 @@ +# Copyright 2016-TODAY Serpent Consulting Services Pvt. Ltd. +# See LICENSE file for full copyright and licensing details. + +from odoo.tests import common + + +class SaleReportProductImageTestCase(common.TransactionCase): + + def setup(self): + super(SaleReportProductImageTestCase, self).setup() + + def test_sale_report_product(self): + self.product = self.env.ref("product.product_product_7") + self.partner = self.env.ref("base.res_partner_2") + + self.sale_order = self.env["sale.order"].create( + { + "partner_id": self.partner.id, + "partner_invoice_id": self.partner.id, + "partner_shipping_id": self.partner.id, + "pricelist_id": self.env.ref("product.list0").id, + "print_image": "True", + "image_sizes": "image_medium", + } + ) + self.sale_order_line = self.env["sale.order.line"].create( + { + "name": self.product and self.product.name or " ", + "product_id": self.product and self.product.id or False, + "product_uom_qty": 2, + "product_uom": self.product.uom_id.id, + "price_unit": self.product.list_price, + "order_id": self.sale_order.id, + "tax_id": False, + "image_small": self.product.image_1920, + } + ) -- cgit v1.2.3