diff --git a/product_volume/__manifest__.py b/product_volume/__manifest__.py index 04293d8cc..b8b2a90e4 100644 --- a/product_volume/__manifest__.py +++ b/product_volume/__manifest__.py @@ -21,7 +21,7 @@ ################################################################################ { 'name': 'Product Volume Calculation', - 'version': '17.0.1.0.1', + 'version': '17.0.1.1.0', 'category': "Inventory", 'summary': """This module will helps you to give dimensions of the product.""", 'description': "Module helps you to manage the length, breadth and height " diff --git a/product_volume/doc/RELEASE_NOTES.md b/product_volume/doc/RELEASE_NOTES.md index 284b9218f..7dc83337e 100644 --- a/product_volume/doc/RELEASE_NOTES.md +++ b/product_volume/doc/RELEASE_NOTES.md @@ -1,5 +1,11 @@ ## Module -#### 21.12.2023 + +#### 24.11.2023 #### Version 17.0.1.0.0 #### ADD - Initial Commit For Product Volume Calculation + +#### 22.12.2023 +#### Version 17.0.1.1.0 +#### UPDT +- Added selecting UOM option diff --git a/product_volume/models/__init__.py b/product_volume/models/__init__.py index c7d10dc3a..fb975a310 100644 --- a/product_volume/models/__init__.py +++ b/product_volume/models/__init__.py @@ -19,5 +19,4 @@ # If not, see . # ################################################################################ -from . import product_product from . import product_template diff --git a/product_volume/models/product_product.py b/product_volume/models/product_product.py deleted file mode 100644 index f99a7c393..000000000 --- a/product_volume/models/product_product.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -################################################################################ -# -# Cybrosys Technologies Pvt. Ltd. -# -# Copyright (C) 2023-TODAY Cybrosys Technologies(). -# Author: Sabeel B (odoo@cybrosys.com) -# -# You can modify it under the terms of the GNU AFFERO -# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. -# -# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE -# (AGPL v3) along with this program. -# If not, see . -# -################################################################################ -from odoo import api, models, fields - - -class ProductProduct(models.Model): - """Inheriting product_template to add new fields""" - _inherit = 'product.product' - - @api.onchange('length', 'breadth', 'height') - def _onchange_product_measures(self): - """Onchange function to calculate volume of the product""" - self.volume = (float(self.length if self.length else 0) * - float(self.breadth if self.breadth else 0) * float( - self.height if self.height else 0)) diff --git a/product_volume/models/product_template.py b/product_volume/models/product_template.py index 8bf5340ed..d9cc79e72 100644 --- a/product_volume/models/product_template.py +++ b/product_volume/models/product_template.py @@ -29,10 +29,47 @@ class ProductDimensionsVolume(models.Model): length = fields.Char(string="Length", help="Enter length of the product") breadth = fields.Char(string="Breadth", help="Enter breadth of the product") height = fields.Char(string="Height", help="Enter height of the product") + length_uom = fields.Selection( + selection=[('meters', 'Meters'), ('centimeters', 'Centimeters'), + ('inches', 'Inches'), ('feet', 'Feet'), ('yards', 'Yards')], + string="UoM", default='meters', required=True, + help="Select the unit of measure for length and") + volume_uom = fields.Selection( + selection=[('cubic_meters', 'Cubic Meters'), + ('cubic_inches', 'Cubic Inches'), + ('cubic_feet', 'Cubic Feet'), + ('cubic_yards', 'Cubic Yards')], + string="UoM of Volume", default='cubic_meters', required=True, + help="Select the unit of measure for volume") - @api.onchange('length', 'breadth', 'height') + @api.onchange('length', 'breadth', 'height', 'length_uom', 'volume_uom') def _onchange_product_measures(self): """Onchange function to calculate volume of the product""" - self.volume = (float(self.length if self.length else 0) * - float(self.breadth if self.breadth else 0) * float( - self.height if self.height else 0)) + volume = 0 + if self.length_uom == "meters": + volume = (float(self.length if self.length else 0) * + float(self.breadth if self.breadth else 0) * float( + self.height if self.height else 0)) + elif self.length_uom == "centimeters": + volume = ((float(self.length if self.length else 0) * float( + self.breadth if self.breadth else 0) * float( + self.height if self.height else 0)) / 1000000) + elif self.length_uom == "inches": + volume = ((float(self.length if self.length else 0) * + float(self.breadth if self.breadth else 0) * + float(self.height if self.height else 0)) / 61023.7) + elif self.length_uom == "feet": + volume = ((float(self.length if self.length else 0) * + float(self.breadth if self.breadth else 0) * + float(self.height if self.height else 0)) / 35.3147) + elif self.length_uom == "yards": + volume = ((float(self.length or 0) * float( + self.breadth or 0) * float(self.height or 0)) / 1.308) + if self.volume_uom == 'cubic_meters': + self.volume = volume + if self.volume_uom == 'cubic_inches': + self.volume = volume * 61023.7 + if self.volume_uom == 'cubic_feet': + self.volume = volume * 35.3147 + if self.volume_uom == 'cubic_yards': + self.volume = volume * 1.308 diff --git a/product_volume/static/description/assets/screenshots/1.png b/product_volume/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..2c638e36a Binary files /dev/null and b/product_volume/static/description/assets/screenshots/1.png differ diff --git a/product_volume/static/description/assets/screenshots/2.png b/product_volume/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..46b245c3c Binary files /dev/null and b/product_volume/static/description/assets/screenshots/2.png differ diff --git a/product_volume/static/description/assets/screenshots/3.png b/product_volume/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..6c728917b Binary files /dev/null and b/product_volume/static/description/assets/screenshots/3.png differ diff --git a/product_volume/static/description/assets/screenshots/4.png b/product_volume/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..c179d93de Binary files /dev/null and b/product_volume/static/description/assets/screenshots/4.png differ diff --git a/product_volume/static/description/assets/screenshots/hero.gif b/product_volume/static/description/assets/screenshots/hero.gif index 76eb1b46e..445255b58 100644 Binary files a/product_volume/static/description/assets/screenshots/hero.gif and b/product_volume/static/description/assets/screenshots/hero.gif differ diff --git a/product_volume/static/description/assets/screenshots/scrnshot-1.png b/product_volume/static/description/assets/screenshots/scrnshot-1.png deleted file mode 100644 index 2cc385191..000000000 Binary files a/product_volume/static/description/assets/screenshots/scrnshot-1.png and /dev/null differ diff --git a/product_volume/static/description/assets/screenshots/scrnshot-2.png b/product_volume/static/description/assets/screenshots/scrnshot-2.png deleted file mode 100644 index e0526b512..000000000 Binary files a/product_volume/static/description/assets/screenshots/scrnshot-2.png and /dev/null differ diff --git a/product_volume/static/description/index.html b/product_volume/static/description/index.html index ce57547aa..43efc9924 100644 --- a/product_volume/static/description/index.html +++ b/product_volume/static/description/index.html @@ -71,7 +71,7 @@

Seamless Adding of Properties.

-

Length, Breadth and Height of the product in the product master page +

Length, Breadth and Height of the product in the product master page.

@@ -87,13 +87,14 @@

Automatic Calculation

-

Automatic calculation of volume with the above details + font-size: 1.2rem; margin-bottom: 2px;">Automatic Calculation.

+

Automatic calculation of volume with the above details.

- + +
+ +
+
+
+

- Provision for the product dimensions.

+ Option to choose the unit of measures.
@@ -132,18 +146,28 @@
- +

- Automatic calculation of volume with the above details.

+ Automatic calculation of volume with the above details. +
+
+ +
+
+
+ +
+
+

+ Option to choose the unit of measure for volume.

- - -
@@ -158,7 +182,6 @@ Automatic Calculation. -
@@ -168,7 +191,7 @@ style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
Version 17.0.1.0.0|Released on:13th November 2023 + style="color: #714B67;font-weight: 600;">Released on:21th December 2023

diff --git a/product_volume/views/product_template_views.xml b/product_volume/views/product_template_views.xml index 037c86e4e..ef4145ad4 100644 --- a/product_volume/views/product_template_views.xml +++ b/product_volume/views/product_template_views.xml @@ -15,23 +15,24 @@

- + kg