summaryrefslogtreecommitdiff
path: root/sales_report_product_image/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-12-01 16:14:05 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-12-01 16:14:05 +0700
commit20533d3b27ad7429c4fc677a321f1504f0f60ef1 (patch)
tree9f42246c33b3ddb457e5c9c059be5bc04a163b6e /sales_report_product_image/models
parent60fa89e3ecac883b6ccafd95d021d55d99a34085 (diff)
add product image in sales and quotation
Diffstat (limited to 'sales_report_product_image/models')
-rw-r--r--sales_report_product_image/models/__init__.py3
-rw-r--r--sales_report_product_image/models/sale_product.py29
2 files changed, 32 insertions, 0 deletions
diff --git a/sales_report_product_image/models/__init__.py b/sales_report_product_image/models/__init__.py
new file mode 100644
index 0000000..5aec2aa
--- /dev/null
+++ b/sales_report_product_image/models/__init__.py
@@ -0,0 +1,3 @@
+# See LICENSE file for full copyright and licensing details.
+
+from . import sale_product
diff --git a/sales_report_product_image/models/sale_product.py b/sales_report_product_image/models/sale_product.py
new file mode 100644
index 0000000..cb7596c
--- /dev/null
+++ b/sales_report_product_image/models/sale_product.py
@@ -0,0 +1,29 @@
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import fields, models
+
+
+class SaleOrder(models.Model):
+ _inherit = "sale.order"
+
+ print_image = fields.Boolean(
+ "Print Image",
+ help="""If ticked, you can see the product image in
+ report of sale order/quotation""",
+ )
+ image_sizes = fields.Selection(
+ [
+ ("image", "Big sized Image"),
+ ("image_medium", "Medium Sized Image"),
+ ("image_small", "Small Sized Image"),
+ ],
+ "Image Sizes",
+ default="image_small",
+ help="Image size to be displayed in report",
+ )
+
+
+class SaleOrderLine(models.Model):
+ _inherit = "sale.order.line"
+
+ image_small = fields.Binary("Product Image", related="product_id.image_1920")