@ -0,0 +1,49 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Website WebAR Product Viewer |
|||
============================ |
|||
This module helps to view Products in Website in 3D. The customers can experience interactive AR commerce using WebAR technology. |
|||
This gives customers a realistic view of the product, show how it will look in real-life environments. |
|||
|
|||
Configuration |
|||
============= |
|||
* No Additional configuration is needed. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
Affero General Public License v3.0 (AGPL v3) |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V17) Bhagyadev KP, |
|||
(V18) Aysha Shalin |
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import controllers |
|||
from . import models |
@ -0,0 +1,52 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
{ |
|||
'name': 'Website WebAR Product Viewer', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Website', |
|||
'summary': """Realistic view of the product in website.""", |
|||
'description': """This module helps to view Products in Website in 3D. |
|||
The customers can experience interactive AR commerce using WebAR |
|||
technology.This gives customers a realistic view of the product, show how |
|||
it will look in real-life environments.""", |
|||
'author': 'Cybrosys Techno solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['website_sale'], |
|||
'data': [ |
|||
"views/product_template_views.xml", |
|||
"views/website_sale_templates.xml", |
|||
], |
|||
'demo': ["data/product_template_demo.xml"], |
|||
'assets': { |
|||
'web.assets_frontend': [ |
|||
'/website_webar_product/static/src/js/website_product_view.js', |
|||
'/website_webar_product/static/src/css/website_product_view.css', |
|||
], |
|||
}, |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import website_webar_product |
@ -0,0 +1,43 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import http |
|||
from odoo.http import request |
|||
|
|||
|
|||
class ProductModel(http.Controller): |
|||
""" This controller provides an endpoint for retrieving AR-related data for |
|||
a given product. """ |
|||
@http.route('/product/ar_image', type='json', auth='none') |
|||
def get_product_ar_model(self, product_id): |
|||
""" This method returns AR related data in the product """ |
|||
product = request.env['product.template'].sudo().browse( |
|||
int(product_id)) |
|||
local_url = request.env['ir.attachment'].sudo().search( |
|||
[('res_model', '=', 'product.template'), |
|||
('res_id', '=', product_id), ('name', '=', product.filename)], |
|||
limit=1).local_url |
|||
return {'type': product.ar_image_type, |
|||
'ar_url': product.ar_url if product.ar_url else False, |
|||
'ar_scale': product.ar_scale, |
|||
'auto_rotate': product.auto_rotate, |
|||
'ar_placement': product.ar_placement, |
|||
'local_url': local_url} |
@ -0,0 +1,24 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Demo data loaded for the AR model Product --> |
|||
<data noupdate="1"> |
|||
<record id="ar_model_product_01" model="product.template"> |
|||
<field name="name">[Demo AR] Recliner Chair</field> |
|||
<field name="categ_id" ref="product.product_category_5"/> |
|||
<field name="standard_price">650.0</field> |
|||
<field name="list_price">750.0</field> |
|||
<field name="weight">2</field> |
|||
<field name="uom_id" ref="uom.product_uom_unit"/> |
|||
<field name="uom_po_id" ref="uom.product_uom_unit"/> |
|||
<field name="enable_ar_images" eval="True"/> |
|||
<field name="ar_image_type">url</field> |
|||
<field name="ar_url">/website_webar_product/static/src/img/Chair.glb</field> |
|||
<field name="auto_rotate" eval="True"/> |
|||
<field name="description_sale">Demo AR Model Chair</field> |
|||
<field name="default_code">FURN_AR_7777</field> |
|||
<field name="is_published" eval="True"/> |
|||
<field name="image_1920" type="base64" file="website_webar_product/static/src/img/Chair.png"/> |
|||
<field name="poster_image" type="base64" file="website_webar_product/static/src/img/Chair.png"/> |
|||
</record> |
|||
</data> |
|||
</odoo> |
@ -0,0 +1,6 @@ |
|||
## Module <website_webar_product> |
|||
|
|||
#### 13.11.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial commit for Website WebAR Product Viewer |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from . import product_template |
@ -0,0 +1,74 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Aysha Shalin (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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################### |
|||
from odoo import api, fields, models |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
"""Extends the base product template model to include Augmented Reality |
|||
(AR) features.""" |
|||
_inherit = 'product.template' |
|||
|
|||
enable_ar_images = fields.Boolean(string="Enable AR images", |
|||
help="Enable to show AR images on the " |
|||
"website.") |
|||
ar_image_type = fields.Selection(selection=[("url", "Url"), |
|||
("upload", "Upload")], |
|||
string="AR Image Type", default='url', |
|||
help='Url:url of image.\n' |
|||
'Upload:Upload image.') |
|||
ar_url = fields.Char(string="Url for AR image", |
|||
help="Provide Valid Url for product AR Model.") |
|||
model_ar = fields.Binary(string="AR Image", attachment=True, |
|||
help="Upload AR Image. Image should be glf/gltf " |
|||
"format.") |
|||
filename = fields.Char(string='File Name', required=True, |
|||
help="File name of uploaded file content.") |
|||
poster_image = fields.Image(string="Poster Image", |
|||
help="Image used for carousal.") |
|||
ar_scale = fields.Selection( |
|||
selection=[("auto", "Auto"), ("fixed", "Fixed")], string="AR Scale", |
|||
default='auto', |
|||
help='Auto: allows the user from scaling the object in AR.\nFixed: is ' |
|||
'used to prevent the user from scaling the object in AR.') |
|||
auto_rotate = fields.Boolean(string="Auto Rotate", |
|||
help="Enables the auto-rotation of image.") |
|||
ar_placement = fields.Selection(selection=[("floor", "Floor"), |
|||
("wall", "Wall")], |
|||
string="AR Placement", default='floor', |
|||
help='Floor : Place the object on floor.\n' |
|||
'Wall: Place the object on wall.') |
|||
|
|||
@api.onchange('model_ar') |
|||
def _onchange_model_ar(self): |
|||
"""Save Product AR model image as attachment.""" |
|||
if self.model_ar: |
|||
if not self.filename.lower().endswith(('.glb', '.gltf')): |
|||
raise UserError( |
|||
"Invalid file format. Please upload a GLB or GLTF file.") |
|||
else: |
|||
self.env['ir.attachment'].create({ |
|||
'name': self.filename, |
|||
'datas': self.model_ar, |
|||
'res_model': 'product.template', |
|||
'res_id': self._origin.id, |
|||
}) |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 751 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 147 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 144 KiB |
After Width: | Height: | Size: 715 KiB |
After Width: | Height: | Size: 205 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 181 KiB |
After Width: | Height: | Size: 9.3 KiB |
@ -0,0 +1,8 @@ |
|||
#model-viewer { |
|||
width:100%; |
|||
height:400px; |
|||
} |
|||
#custom-ar-button{ |
|||
position: absolute; |
|||
bottom: 0px; |
|||
} |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 12 KiB |