diff --git a/product_variant_import/README.rst b/product_variant_import/README.rst new file mode 100644 index 000000000..044160065 --- /dev/null +++ b/product_variant_import/README.rst @@ -0,0 +1,53 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Import Product variant +====================== +This module is used to import the product and their attributes using xlsx file +and csv file.And also through this files with product importing we can also +import some basic fields such as char ,many2one and many2many fields.Using this +module we can update a product using the product's internal reference +or barcode we can change the date through the importing and also these can be +implemented using the two files. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + + +Credits +------- +* Developer: (V16) Gayathri V, 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 `__ + +Further information +=================== +HTML Description: ``__ \ No newline at end of file diff --git a/product_variant_import/__init__.py b/product_variant_import/__init__.py new file mode 100644 index 000000000..80e3c90bc --- /dev/null +++ b/product_variant_import/__init__.py @@ -0,0 +1,23 @@ +"""Import product variant""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import wizards diff --git a/product_variant_import/__manifest__.py b/product_variant_import/__manifest__.py new file mode 100644 index 000000000..4ea673a10 --- /dev/null +++ b/product_variant_import/__manifest__.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Import Product variant', + 'version': '17.0.1.0.0', + 'category': 'Sales', + 'summary': """This module is used to import the product and product + variants.""", + 'description': """This module is used to import the product and their + attributes using xlsx file and csv file. And also through this files with + product importing we can also import some basic fields such as char,many2one + and many2many fields.Using this module we can update a product using the + product's internal reference or barcode we can change the date through the + importing and also these can be implemented using the two files.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale_management', 'stock'], + 'data': [ + 'security/ir.model.access.csv', + 'security/product_variant_import_groups.xml', + 'wizards/import_product_variant_views.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/product_variant_import/doc/RELEASE_NOTES.md b/product_variant_import/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..6ba5618eb --- /dev/null +++ b/product_variant_import/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 20.10.2024 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Import Product variant diff --git a/product_variant_import/security/ir.model.access.csv b/product_variant_import/security/ir.model.access.csv new file mode 100644 index 000000000..6bbf62355 --- /dev/null +++ b/product_variant_import/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access.import.product.variant_user,access.import.product.variant.user,model_import_product_variant,base.group_user,1,1,1,1 diff --git a/product_variant_import/security/product_variant_import_groups.xml b/product_variant_import/security/product_variant_import_groups.xml new file mode 100644 index 000000000..b0cfe20e7 --- /dev/null +++ b/product_variant_import/security/product_variant_import_groups.xml @@ -0,0 +1,13 @@ + + + + + Import + Import Product Variant + 10 + + + Variant Manager + + + diff --git a/product_variant_import/static/description/assets/icons/check.png b/product_variant_import/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/product_variant_import/static/description/assets/icons/check.png differ diff --git a/product_variant_import/static/description/assets/icons/chevron.png b/product_variant_import/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/chevron.png differ diff --git a/product_variant_import/static/description/assets/icons/cogs.png b/product_variant_import/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/cogs.png differ diff --git a/product_variant_import/static/description/assets/icons/consultation.png b/product_variant_import/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/product_variant_import/static/description/assets/icons/consultation.png differ diff --git a/product_variant_import/static/description/assets/icons/ecom-black.png b/product_variant_import/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/ecom-black.png differ diff --git a/product_variant_import/static/description/assets/icons/education-black.png b/product_variant_import/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/product_variant_import/static/description/assets/icons/education-black.png differ diff --git a/product_variant_import/static/description/assets/icons/hotel-black.png b/product_variant_import/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/product_variant_import/static/description/assets/icons/hotel-black.png differ diff --git a/product_variant_import/static/description/assets/icons/license.png b/product_variant_import/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/product_variant_import/static/description/assets/icons/license.png differ diff --git a/product_variant_import/static/description/assets/icons/lifebuoy.png b/product_variant_import/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/product_variant_import/static/description/assets/icons/lifebuoy.png differ diff --git a/product_variant_import/static/description/assets/icons/manufacturing-black.png b/product_variant_import/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/product_variant_import/static/description/assets/icons/manufacturing-black.png differ diff --git a/product_variant_import/static/description/assets/icons/pos-black.png b/product_variant_import/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/pos-black.png differ diff --git a/product_variant_import/static/description/assets/icons/puzzle.png b/product_variant_import/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/puzzle.png differ diff --git a/product_variant_import/static/description/assets/icons/restaurant-black.png b/product_variant_import/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/restaurant-black.png differ diff --git a/product_variant_import/static/description/assets/icons/service-black.png b/product_variant_import/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/product_variant_import/static/description/assets/icons/service-black.png differ diff --git a/product_variant_import/static/description/assets/icons/trading-black.png b/product_variant_import/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/product_variant_import/static/description/assets/icons/trading-black.png differ diff --git a/product_variant_import/static/description/assets/icons/training.png b/product_variant_import/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/product_variant_import/static/description/assets/icons/training.png differ diff --git a/product_variant_import/static/description/assets/icons/update.png b/product_variant_import/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/product_variant_import/static/description/assets/icons/update.png differ diff --git a/product_variant_import/static/description/assets/icons/user.png b/product_variant_import/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/product_variant_import/static/description/assets/icons/user.png differ diff --git a/product_variant_import/static/description/assets/icons/wrench.png b/product_variant_import/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/product_variant_import/static/description/assets/icons/wrench.png differ diff --git a/product_variant_import/static/description/assets/misc/Cybrosys R.png b/product_variant_import/static/description/assets/misc/Cybrosys R.png new file mode 100755 index 000000000..da4058087 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/Cybrosys R.png differ diff --git a/product_variant_import/static/description/assets/misc/categories.png b/product_variant_import/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/categories.png differ diff --git a/product_variant_import/static/description/assets/misc/check-box.png b/product_variant_import/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/check-box.png differ diff --git a/product_variant_import/static/description/assets/misc/compass.png b/product_variant_import/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/product_variant_import/static/description/assets/misc/compass.png differ diff --git a/product_variant_import/static/description/assets/misc/corporate.png b/product_variant_import/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/product_variant_import/static/description/assets/misc/corporate.png differ diff --git a/product_variant_import/static/description/assets/misc/customer-support.png b/product_variant_import/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/product_variant_import/static/description/assets/misc/customer-support.png differ diff --git a/product_variant_import/static/description/assets/misc/cybrosys-logo.png b/product_variant_import/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/product_variant_import/static/description/assets/misc/cybrosys-logo.png differ diff --git a/product_variant_import/static/description/assets/misc/features.png b/product_variant_import/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/features.png differ diff --git a/product_variant_import/static/description/assets/misc/logo.png b/product_variant_import/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/product_variant_import/static/description/assets/misc/logo.png differ diff --git a/product_variant_import/static/description/assets/misc/pictures.png b/product_variant_import/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/pictures.png differ diff --git a/product_variant_import/static/description/assets/misc/pie-chart.png b/product_variant_import/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/pie-chart.png differ diff --git a/product_variant_import/static/description/assets/misc/right-arrow.png b/product_variant_import/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/right-arrow.png differ diff --git a/product_variant_import/static/description/assets/misc/star.png b/product_variant_import/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/product_variant_import/static/description/assets/misc/star.png differ diff --git a/product_variant_import/static/description/assets/misc/support.png b/product_variant_import/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/support.png differ diff --git a/product_variant_import/static/description/assets/misc/whatsapp.png b/product_variant_import/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/product_variant_import/static/description/assets/misc/whatsapp.png differ diff --git a/product_variant_import/static/description/assets/modules/1.jpg b/product_variant_import/static/description/assets/modules/1.jpg new file mode 100755 index 000000000..e19e7ab11 Binary files /dev/null and b/product_variant_import/static/description/assets/modules/1.jpg differ diff --git a/product_variant_import/static/description/assets/modules/2.jpg b/product_variant_import/static/description/assets/modules/2.jpg new file mode 100755 index 000000000..3f6a08970 Binary files /dev/null and b/product_variant_import/static/description/assets/modules/2.jpg differ diff --git a/product_variant_import/static/description/assets/modules/3.jpg b/product_variant_import/static/description/assets/modules/3.jpg new file mode 100755 index 000000000..33491bcf0 Binary files /dev/null and b/product_variant_import/static/description/assets/modules/3.jpg differ diff --git a/product_variant_import/static/description/assets/modules/4.png b/product_variant_import/static/description/assets/modules/4.png new file mode 100755 index 000000000..612be4b77 Binary files /dev/null and b/product_variant_import/static/description/assets/modules/4.png differ diff --git a/product_variant_import/static/description/assets/modules/5.jpg b/product_variant_import/static/description/assets/modules/5.jpg new file mode 100755 index 000000000..693671ccf Binary files /dev/null and b/product_variant_import/static/description/assets/modules/5.jpg differ diff --git a/product_variant_import/static/description/assets/modules/6.png b/product_variant_import/static/description/assets/modules/6.png new file mode 100755 index 000000000..a0ac2d840 Binary files /dev/null and b/product_variant_import/static/description/assets/modules/6.png differ diff --git a/product_variant_import/static/description/assets/screenshots/hero.gif b/product_variant_import/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..01b0bd4d5 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/hero.gif differ diff --git a/product_variant_import/static/description/assets/screenshots/image1.png b/product_variant_import/static/description/assets/screenshots/image1.png new file mode 100644 index 000000000..b4a34d989 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image1.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image10.png b/product_variant_import/static/description/assets/screenshots/image10.png new file mode 100644 index 000000000..5bd55aa96 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image10.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image12.png b/product_variant_import/static/description/assets/screenshots/image12.png new file mode 100644 index 000000000..66abf24ae Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image12.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image2.png b/product_variant_import/static/description/assets/screenshots/image2.png new file mode 100644 index 000000000..f8b4b580c Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image2.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image3.png b/product_variant_import/static/description/assets/screenshots/image3.png new file mode 100644 index 000000000..17b19f659 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image3.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image4.png b/product_variant_import/static/description/assets/screenshots/image4.png new file mode 100644 index 000000000..fe4b0fde9 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image4.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image5.png b/product_variant_import/static/description/assets/screenshots/image5.png new file mode 100644 index 000000000..9e1fcdc68 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image5.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image6.png b/product_variant_import/static/description/assets/screenshots/image6.png new file mode 100644 index 000000000..5e836ce9a Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image6.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image7.png b/product_variant_import/static/description/assets/screenshots/image7.png new file mode 100644 index 000000000..4cb8cef0e Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image7.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image8.png b/product_variant_import/static/description/assets/screenshots/image8.png new file mode 100644 index 000000000..5774ee444 Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image8.png differ diff --git a/product_variant_import/static/description/assets/screenshots/image9.png b/product_variant_import/static/description/assets/screenshots/image9.png new file mode 100644 index 000000000..05bab546e Binary files /dev/null and b/product_variant_import/static/description/assets/screenshots/image9.png differ diff --git a/product_variant_import/static/description/banner.jpg b/product_variant_import/static/description/banner.jpg new file mode 100644 index 000000000..9bf829b52 Binary files /dev/null and b/product_variant_import/static/description/banner.jpg differ diff --git a/product_variant_import/static/description/icon.png b/product_variant_import/static/description/icon.png new file mode 100644 index 000000000..e78f1e74b Binary files /dev/null and b/product_variant_import/static/description/icon.png differ diff --git a/product_variant_import/static/description/index.html b/product_variant_import/static/description/index.html new file mode 100755 index 000000000..2e21034bc --- /dev/null +++ b/product_variant_import/static/description/index.html @@ -0,0 +1,842 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Import Product Variant

+

+ This Module Is Helps To Import Product And Product Variants. + +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ This module is used to import the product and their attributes using + xlsx file and csv file. And also through these files with product + importing we can also import some + basic fields such as char ,many2one and many2many fields.Using this + module we can update a product using the product's internal + reference or barcode we can change the date through the importing + and also these can be implemented using the two files.

+
+
+
+
+
+
+ +
+
+

+ You can or update product variants by barcode & internal reference.

+
+
+
+
+
+
+ +
+
+

+ You can import product images by image URL or local image path.

+
+
+
+
+
+
+ +
+
+

+ Easy to create and update product variants.

+
+
+
+
+
+
+ +
+
+

+ Easy to import custom fields with product variants..

+
+
+
+
+
+
+ +
+
+

+ Easy to import Product Variant (image, price, invoicing type, product type etc.) from CSV or Excel.

+
+
+
+
+
+
+ +
+
+

Useful for mass records.

+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

+ Set the user access.

+

+ +

+
+
+
+
+
+
+ +
+
+

+ Import menu in the sales module under the product tab.

+
+
+
+
+
+
+ + +
+
+

+ Sample example of csv file. +

+
+
+
+
+
+
+ +
+
+

+ Upload csv/xlsx file to create the product with + variants. +

+
+
+
+
+
+
+ + + +
+
+

+ Sample example of xlsx file. +

+
+
+
+
+
+
+ +
+
+

+ Upload you csv/xlsx file to create/update the product with + variants.

+ +
+
+
+
+
+
+ +
+
+

+ Imported product with image.

+ +
+
+
+ +
+
+
+
    +
  • + Available in + Odoo 18.0 Community and Enterprise +
  • +
  • + Useful for mass records. + +
  • +
  • + Easy to import Product Variant (image, price, invoicing type, product type etc.) from CSV or Excel. + +
  • +
+
+
+
+
+
+
Version + 18.0.1.0.0|Released on:19th October 2024 +
+

+ Initial Commit for Import Product Variant

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/product_variant_import/static/test_files/prdoct_create_test.csv b/product_variant_import/static/test_files/prdoct_create_test.csv new file mode 100644 index 000000000..7af924980 --- /dev/null +++ b/product_variant_import/static/test_files/prdoct_create_test.csv @@ -0,0 +1,2 @@ +Unique Identifier,Name,Internal Reference,Canbe Sold,Canbe Purchased,Product Type,Category,Unit of Measure,Purchase Unit of Measure,Customer Taxes,Vendor Taxes,Description for customers,Invoicing Policy,Sales Price,Cost,Variant Attributes,Attribute Values,Internal Reference,Barcode,Weight,Volume,Qty On hand,Responsible,Image,x_char_testtext,x_many2many_testnamepartner,x_many2one_testpartner2 +1,Chair,Chair,TRUE,TRUE,Storable Product,All,Units,Units,Tax 15 %,Tax 20 %,Try This One,Delivered quantities,295,120.5,Legs,"Steel,Aluminium",Chair,OO10,10.7,7.7,100,OdooBot,/home/cybrosys/Downloads/test.jpg,Hello,res.partner:Mitchel Admin,res.partner:Mitchell Admin diff --git a/product_variant_import/static/test_files/product_test.xlsx b/product_variant_import/static/test_files/product_test.xlsx new file mode 100644 index 000000000..cd1ee33fa Binary files /dev/null and b/product_variant_import/static/test_files/product_test.xlsx differ diff --git a/product_variant_import/wizards/__init__.py b/product_variant_import/wizards/__init__.py new file mode 100644 index 000000000..15c2505df --- /dev/null +++ b/product_variant_import/wizards/__init__.py @@ -0,0 +1,23 @@ +"""Import product variant""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import import_product_variant diff --git a/product_variant_import/wizards/import_product_variant.py b/product_variant_import/wizards/import_product_variant.py new file mode 100644 index 000000000..79490fe01 --- /dev/null +++ b/product_variant_import/wizards/import_product_variant.py @@ -0,0 +1,694 @@ +""""Import product variant""" +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import os +import base64, binascii, csv, io, tempfile, requests, xlrd +from odoo import fields, models, _ +from odoo.exceptions import UserError +from openpyxl import load_workbook +import re + +import base64 +import binascii +import tempfile +import certifi +import urllib3 +import xlrd +from odoo import models, fields, _ +import csv +import base64 +import openpyxl +from io import BytesIO +from odoo.exceptions import UserError +from odoo.tools import ustr + + +class ImportVariant(models.TransientModel): + """Wizard for selecting the imported Files""" + _name = 'import.product.variant' + _description = "Import Product Variants" + + import_file = fields.Selection( + [('csv', 'CSV File'), ('excel', 'Excel File')], required=True, + string="Import FIle", help="Import the files") + method = fields.Selection([('create', 'Create Product'), + ('update', 'Update Product'), ( + 'update_product', + 'Update Product Variant'), ], + string="Method", required=True, + help="Method for importing/Exporting") + file = fields.Binary(string="File", required=True, + help="The file to upload") + + def action_import_product_variant(self): + """This is used to import/export the product """ + try: + global list, detailed, invoicing_type + link = False + if self.import_file == 'excel': + try: + file_pointer = tempfile.NamedTemporaryFile(delete=False, + suffix=".xlsx") + file_pointer.write(binascii.a2b_base64(self.file)) + file_pointer.seek(0) + workbook = load_workbook(filename=file_pointer.name) + sheet = workbook['Sheet1'] + except: + raise UserError(_("File not Valid")) + for index, row in enumerate(sheet.iter_rows(values_only=True)): + if index == 0: + continue # Skip the first row + # if rec >= 1: + if row: + row_vals = row + if len(row_vals) < int(24): + raise UserError( + _("Please ensure that you selected " + "the correct file")) + product_category = self.env['product.category'].search( + [('complete_name', '=', row_vals[6])]).id + if product_category: + category = product_category + else: + category = self.env['product.category'].create({ + 'name': row_vals[6].split('/')[0], + 'complete_name': row_vals[6] + }) + category = category.id + product_uom = self.env['uom.uom'].search( + [('name', '=', row_vals[7])]).id + if product_uom: + uom = product_uom + else: + raise UserError(_("Invalid uom")) + pro_uom = self.env['uom.uom'].search( + [('name', '=', row_vals[8])]).id + if pro_uom: + po_uom = pro_uom + else: + raise UserError(_("Invalid Purchase uom")) + + def calculate_tax_value(val): + if isinstance(val, float) and val < 1: + return val * 100, f"{val * 100}%" + return val, val + + def create_tax_record(name, amount, tax_type): + match = re.search(r'\d+', name) + amount = int(match.group()) if match else amount + return self.env['account.tax'].create({ + 'name': name, + 'amount': amount, + 'type_tax_use': tax_type, + }).id + + account_val, account_name = calculate_tax_value( + row_vals[9]) + supp_val, supp_name = calculate_tax_value(row_vals[10]) + + account_tax = self.env['account.tax'].search( + [('name', '=', account_name), + ('type_tax_use', '=', 'sale')]).id + supp_tax = self.env['account.tax'].search( + [('name', '=', supp_name), + ('type_tax_use', '=', 'purchase')]).id + + tax = account_tax if account_tax else create_tax_record( + account_name, account_val, 'sale') + supplier_tax = supp_tax if supp_tax else create_tax_record( + supp_name, supp_val, 'purchase') + + kay_val_dict = dict( + self.env['product.template']._fields[ + 'detailed_type'].selection) + # here 'type' is field name + for key, val in kay_val_dict.items(): + if val == row_vals[5]: + detailed = key + kay_val_dict = dict( + self.env['product.template']._fields[ + 'invoice_policy'].selection) + # here 'type' is field name + for key, val in kay_val_dict.items(): + if val == row_vals[12]: + invoicing_type = key + if "http://" in row_vals[23] or "https://" in row_vals[ + 23]: + link = base64.b64encode( + requests.get( + row_vals[23].strip()).content).replace( + b"\n", b"") + elif "/home" in row_vals[23]: + if os.path.exists(row_vals[23]): + with open(row_vals[23], 'rb') as image_file: + link = base64.b64encode(image_file.read()) + if not row_vals[2] or not row_vals[18]: + raise UserError(_("File Must Contain Internal " + "Reference or Barcode of the " + "Product")) + if self.method == 'update': + vals = { + 'default_code': row_vals[2], + 'name': row_vals[1], + 'image_1920': link, + 'sale_ok': row_vals[3], + 'purchase_ok': row_vals[4], + 'detailed_type': detailed, + 'categ_id': category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'description_sale': row_vals[11], + 'invoice_policy': invoicing_type, + 'list_price': row_vals[13], + 'standard_price': row_vals[14], + 'weight': row_vals[19], + 'volume': row_vals[20], + } + if link: + vals.update({'image_1920': link}) + product = self.env['product.template'].search( + [('barcode', '=', row_vals[18])]) + if product: + product.write(vals) + else: + product = self.env['product.template'].search( + [('default_code', '=', row_vals[2])]) + if product: + product.write(vals) + else: + raise UserError( + _("Please ensure that product " + "having the" + "contains Internal reference or " + "Barcode to with your file")) + else: + if self.method == 'update_product': + vals = { + 'default_code': row_vals[2], + 'name': row_vals[1], + 'image_1920': link, + 'sale_ok': row_vals[3], + 'purchase_ok': row_vals[4], + 'detailed_type': detailed, + 'categ_id': category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'supplier_taxes_id': [(6, 0, [supplier_tax])], + 'description_sale': row_vals[11], + 'invoice_policy': invoicing_type, + 'lst_price': row_vals[13], + 'standard_price': row_vals[14], + 'weight': row_vals[19], + 'volume': row_vals[20], + } + if link: + vals.update({'image_1920': link}) + product = self.env['product.product'].search( + [('barcode', '=', row_vals[18])]) + if product: + product.write(vals) + else: + product = self.env[ + 'product.product'].search( + [('default_code', '=', row_vals[2])]) + if product: + product.write(vals) + else: + raise UserError( + _("Please ensure that product " + "having the" + "contains Internal reference or " + "Barcode to with your file.")) + else: + vals = { + 'default_code': row_vals[2], + 'name': row_vals[1], + 'image_1920': link, + 'sale_ok': row_vals[3], + 'purchase_ok': row_vals[4], + 'detailed_type': detailed, + 'categ_id': category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'description_sale': row_vals[11], + 'invoice_policy': invoicing_type, + 'list_price': row_vals[13], + 'standard_price': row_vals[14], + 'weight': row_vals[19], + 'volume': row_vals[20], + + } + product = self.env['product.template'].create( + vals) + values = [] + for row_val in row_vals[15].split(','): + pr_attribute = self.env['product.attribute'].search( + [('name', '=', row_val)]).id + if pr_attribute: + attribute = pr_attribute + else: + raise UserError( + _("Please update a valid attribute and " + "values")) + values.append({'attribute': attribute}) + for row in row_vals[16].split(','): + attri_values = self.env[ + 'product.attribute.value'].search( + [('attribute_id', '=', attribute), + ('name', '=', row)]).ids + if len(attri_values) != 0: + values.extend({attri_values[0]}) + variant = {} + mylist = [] + for val in values: + if isinstance(val, dict): + variant = val + variant['attribut_value'] = [] + else: + variant['attribut_value'].extend([val]) + if variant in mylist: + pass + else: + mylist.append(variant) + for lst in mylist: + val = { + 'product_tmpl_id': product.id, + 'attribute_id': lst['attribute'], + 'value_ids': lst['attribut_value'], + } + self.env['product.template.attribute.line'].create( + val) + elif self.import_file == 'csv': + keys = ['Unique Identifier', 'Name', 'Internal Reference', + 'Can be sold', 'Can be Purchased', 'Product Type', + 'Category', 'Unit of Measure', + 'Purchase Unit of Measure', + 'Customer Taxes', 'Vendor Taxes', + 'Description for customers', 'Invoicing Policy', + 'Sales Price', 'Cost', 'Variant Attributes', + 'Attribute Values', 'Internal Reference', 'Barcode', + 'Weight', 'Volume', 'Qty On hand', + 'Responsible', 'image', 'Char', 'Many2many', 'Many2one', + 'Integer'] + try: + files = base64.b64decode(self.file) + data = io.StringIO(files.decode("utf-8")) + data.seek(0) + file_reader = [] + csv_reader = csv.reader(data, delimiter=',') + file_reader.extend(csv_reader) + except: + raise UserError(_("File not Valid")) + for file in range(len(file_reader)): + field = list(map(str, file_reader[file])) + values = dict(zip(keys, field)) + if file >= 1: + pro_categ = self.env['product.category'].search( + [('complete_name', '=', values['Category'])]).id + if pro_categ: + pro_category = pro_categ + else: + category = self.env['product.category'].create({ + 'name': values['Category'] + }) + pro_category = category.id + unit_uom = self.env['uom.uom'].search( + [('name', '=', values['Unit of Measure'])]).id + if unit_uom: + uom = unit_uom + else: + raise UserError(_("Invalid uom")) + po_uoms = self.env['uom.uom'].search( + [('name', '=', + values['Purchase Unit of Measure'])]).id + if po_uoms: + po_uom = po_uoms + else: + raise UserError(_("Invalid Product Uom")) + def calculate_tax_value(val): + if isinstance(val, float) and val < 1: + return val * 100, f"{val * 100}%" + return val, val + + def create_tax_record(name, amount, tax_type): + match = re.search(r'\d+', name) + amount = int(match.group()) if match else amount + return self.env['account.tax'].create({ + 'name': name, + 'amount': amount, + 'type_tax_use': tax_type, + }).id + + account_val, account_name = calculate_tax_value( + values['Customer Taxes']) + supp_val, supp_name = calculate_tax_value(values['Vendor Taxes']) + + account_tax = self.env['account.tax'].search( + [('name', '=', account_name), + ('type_tax_use', '=', 'sale')]).id + supp_tax = self.env['account.tax'].search( + [('name', '=', supp_name), + ('type_tax_use', '=', 'purchase')]).id + + tax = account_tax if account_tax else create_tax_record( + account_name, account_val, 'sale') + supplier_tax = supp_tax if supp_tax else create_tax_record( + supp_name, supp_val, 'purchase') + + kay_val_dict = dict( + self.env['product.template']._fields[ + 'detailed_type'].selection) # here 'type' is field name + for key, val in kay_val_dict.items(): + if val == values['Product Type']: + detailed = key + kay_val_dict = dict( + self.env['product.template']._fields[ + 'invoice_policy'].selection) # here 'type' is field name + for key, val in kay_val_dict.items(): + if val == values['Invoicing Policy']: + invoicing_type = key + if "http://" in values['image'] or "https://" in values[ + 'image']: + link = base64.b64encode(requests.get( + values['image'].strip()).content).replace(b"\n", + b"") + elif "/home" in values['image']: + if os.path.exists(values['image']): + with open(values['image'], 'rb') as file_image: + link = base64.b64encode(file_image.read()) + + if file_reader[0][24] or file_reader[0][25] or \ + file_reader[0][26]: + model = self.env['ir.model']._get_id( + 'product.template') + self.env['ir.model.fields'].create({ + 'model_id': model, + 'name': file_reader[0][24], + 'field_description': + file_reader[0][24].split('_')[ + 2].upper(), + 'ttype': file_reader[0][24].split('_')[1], + }) + inherit_id = self.env.ref( + 'product.product_template_only_form_view') + arch_base = _('' + '' + '' + '' + '' + '') % ( + 'detailed_type', 'after', + file_reader[0][24]) + self.env['ir.ui.view'].sudo().create( + {'name': 'product.dynamic.fields', + 'type': 'form', + 'model': 'product.template', + 'mode': 'extension', + 'inherit_id': inherit_id.id, + 'arch_base': arch_base, + 'active': True}) + self.env['ir.model.fields'].create({ + 'model_id': model, + 'name': file_reader[0][25], + 'field_description': + file_reader[0][25].split('_')[ + 2].upper(), + 'relation': values['Many2many'].split(':')[0], + 'ttype': file_reader[0][25].split('_')[1], + }) + inherit_id = self.env.ref( + 'product.product_template_only_form_view') + arch_base = _('' + '' + '' + '' + '' + '') % ( + 'taxes_id', 'after', + file_reader[0][25], + 'many2many_tags') + self.env['ir.ui.view'].sudo().create( + {'name': 'product.many2many.fields', + 'type': 'form', + 'model': 'product.template', + 'mode': 'extension', + 'inherit_id': inherit_id.id, + 'arch_base': arch_base, + 'active': True}) + val = values['Many2many'].split(':')[0] + partner = [ + values['Many2many'].split(':')[1].split(',')] + vals_many = [] + for part in partner[0]: + many2many = self.env[val].search( + [('name', '=', part)]).id + if many2many: + vals_many.append(many2many) + else: + partner = self.env[val].create({ + 'name': part, + }) + vals_many.append(partner) + self.env['ir.model.fields'].create({ + 'model_id': model, + 'name': file_reader[0][26], + 'field_description': + file_reader[0][26].split('_')[ + 2].upper(), + 'relation': values['Many2one'].split(':')[0], + 'ttype': file_reader[0][26].split('_')[1], + }) + inherit_id = self.env.ref( + 'product.product_template_only_form_view') + arch_base = _('' + '' + '' + '' + '' + '') % ( + 'categ_id', 'after', + file_reader[0][26], + 'many2one_tags') + self.env['ir.ui.view'].sudo().create( + {'name': 'product.many2one.fields', + 'type': 'form', + 'model': 'product.template', + 'mode': 'extension', + 'inherit_id': inherit_id.id, + 'arch_base': arch_base, + 'active': True}) + many2one = values['Many2one'].split(':')[0] + value = [values['Many2one'].split(':')[1]] + vals_one = [] + for vals in value: + many2one_value = self.env[many2one].search( + [('name', '=', vals)]).id + if many2one_value: + vals_one.append(many2one_value) + else: + value = self.env[many2one].create({ + 'name': vals, + }) + vals_one.append(value) + if not values['Internal Reference'] or not values[ + 'Barcode']: + raise UserError( + _("File Must Contain Internal Reference " + "or Barcode of the Product")) + if self.method == 'update': + vals = { + 'default_code': values[ + 'Internal Reference'] if + values['Internal Reference'] else False, + 'name': values['Name'], + 'image_1920': link, + 'sale_ok': values['Can be sold'], + 'purchase_ok': values['Can be Purchased'], + 'detailed_type': detailed, + 'categ_id': pro_category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'barcode': values['Barcode'] if values[ + 'Barcode'] else False, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'description_sale': values[ + 'Description for customers'], + 'invoice_policy': invoicing_type, + 'list_price': values['Sales Price'], + 'standard_price': values['Cost'], + 'weight': values['Weight'], + 'volume': values['Volume'], + } + if link: + vals.update({'image_1920': link}) + product = self.env[ + 'product.template'].search( + [('barcode', '=', values['Barcode'])]) + if len(product): + product.write(vals) + else: + product = self.env[ + 'product.template'].search( + [('default_code', '=', + values['Internal Reference'])]) + if product: + product.write(vals) + else: + raise UserError( + _("Please ensure that product " + "having the" + "contains Internal reference or " + "Barcode to with your file.")) + elif self.method == 'update_product': + vals = { + 'default_code': values[ + 'Internal Reference'] if + values['Internal Reference'] else False, + 'name': values['Name'], + 'image_1920': link, + 'sale_ok': values['Can be sold'], + 'purchase_ok': values['Can be Purchased'], + 'detailed_type': detailed, + 'categ_id': pro_category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'barcode': values['Barcode'] if values[ + 'Barcode'] else False, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'description_sale': values[ + 'Description for customers'], + 'invoice_policy': invoicing_type, + 'lst_price': values['Sales Price'], + 'standard_price': values['Cost'], + 'weight': values['Weight'], + 'volume': values['Volume'], + } + if link: + vals.update({'image_1920': link}) + product = self.env[ + 'product.product'].search( + [('barcode', '=', values['Barcode'])]) + if len(product): + product.write(vals) + else: + product = self.env[ + 'product.product'].search( + [('default_code', '=', + values['Internal Reference'])]) + if product: + product.write(vals) + else: + raise UserError( + _("Please ensure that product " + "having the" + "contains Internal reference or " + "Barcode to with your file.")) + else: + vals = { + 'default_code': values[ + 'Internal Reference'] if + values['Internal Reference'] else False, + 'name': values['Name'], + 'image_1920': link, + 'sale_ok': values['Can be sold'], + 'purchase_ok': values['Can be Purchased'], + 'detailed_type': detailed, + 'categ_id': pro_category, + 'uom_id': uom, + 'uom_po_id': po_uom, + 'barcode': values['Barcode'] if values[ + 'Barcode'] else False, + 'taxes_id': [tax], + 'supplier_taxes_id': [supplier_tax], + 'description_sale': values[ + 'Description for customers'], + 'invoice_policy': invoicing_type, + 'list_price': values['Sales Price'], + 'standard_price': values['Cost'], + 'weight': values['Weight'], + 'volume': values['Volume'], + } + product = self.env['product.template'].create(vals) + product.write({ + file_reader[0][24]: values['Char'], + file_reader[0][25]: vals_many[0], + file_reader[0][26]: vals_one[0], + }) + attribute_values = [] + for val_attribute in values[ + 'Variant Attributes'].split(','): + attributes = self.env[ + 'product.attribute'].search( + [('name', '=', val_attribute)]).id + if attributes: + attribute = attributes + else: + raise UserError( + _("Please add a valid attribute and " + "their values")) + attribute_values.append( + {'attribute': attribute}) + for value in values['Attribute Values'].split( + ','): + attri_values = self.env[ + 'product.attribute.value'].search( + [('attribute_id', '=', attribute), + ('name', '=', value)]).ids + if len(attri_values) != 0: + attribute_values.extend( + {attri_values[0]}) + variant = {} + mylist = [] + for attribute in attribute_values: + if isinstance(attribute, dict): + variant = attribute + variant['attribut_value'] = [] + else: + variant['attribut_value'].extend( + [attribute]) + if variant in mylist: + pass + else: + mylist.append(variant) + for list in mylist: + val = { + 'product_tmpl_id': product.id, + 'attribute_id': list['attribute'], + 'value_ids': list['attribut_value'], + } + self.env[ + 'product.template.attribute.line'].create( + val) + return { + 'type': 'ir.actions.client', + 'tag': 'reload', + } + except UserError as e: + raise UserError(str(e)) diff --git a/product_variant_import/wizards/import_product_variant_views.xml b/product_variant_import/wizards/import_product_variant_views.xml new file mode 100644 index 000000000..b2213fa8a --- /dev/null +++ b/product_variant_import/wizards/import_product_variant_views.xml @@ -0,0 +1,43 @@ + + + + + Product Variant + ir.actions.act_window + import.product.variant + form + new + + + + import.product.variant.view.form + import.product.variant + form + +
+ + + + + + + +
+
+
+
+
+ + + + +