summaryrefslogtreecommitdiff
path: root/sales_report_product_image/models
diff options
context:
space:
mode:
authorroot <root@prod-erp-indoteknikcom.c.project-indoteknik-com.internal>2023-12-01 16:22:55 +0700
committerroot <root@prod-erp-indoteknikcom.c.project-indoteknik-com.internal>2023-12-01 16:22:55 +0700
commitdc7aeffb5fe113d1a624f86a5bd91eb18f9c2b99 (patch)
tree2655ff3c8fccf4ded15a29fa2d92d90f8f942d68 /sales_report_product_image/models
parentd0375df5691e2c4c008645a09d01d4592e798d02 (diff)
parent20533d3b27ad7429c4fc677a321f1504f0f60ef1 (diff)
Merge branch 'master' of bitbucket.org:altafixco/indoteknik14
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")