diff --git a/dynamic_product_label_print/README.rst b/dynamic_product_label_print/README.rst new file mode 100644 index 000000000..e3f4426db --- /dev/null +++ b/dynamic_product_label_print/README.rst @@ -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 + +Dynamic Product Label Print +=========================== +Dynamically print the barcode and product fields of multiple products. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + + +Credits +------- +* Developer: (V16) Ammu Raj, + (V17) Kailas Krishna, + (V18) Kailas Krishna, 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: ``__ diff --git a/dynamic_product_label_print/__init__.py b/dynamic_product_label_print/__init__.py new file mode 100644 index 000000000..3fab1b802 --- /dev/null +++ b/dynamic_product_label_print/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 . import models +from . import report +from . import wizard diff --git a/dynamic_product_label_print/__manifest__.py b/dynamic_product_label_print/__manifest__.py new file mode 100644 index 000000000..b297ca93a --- /dev/null +++ b/dynamic_product_label_print/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 . +# +############################################################################# +{ + 'name': 'Dynamic Product Label Print', + 'version': '18.0.1.0.0', + 'category': 'Warehouse', + 'summary': "Print Label Dynamically for multiple products", + 'description': "Dynamically print the barcode and product fields of multiple products", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['stock'], + 'data': [ + 'security/ir.model.access.csv', + 'report/label_layout_templates.xml', + 'views/dynamic_template_views.xml', + 'wizard/product_label_layout_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/dynamic_product_label_print/doc/RELEASE_NOTES.md b/dynamic_product_label_print/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..802a0be94 --- /dev/null +++ b/dynamic_product_label_print/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 28.10.2024 +#### Version 18.0.1.0.0 +#### ADD + +- Initial commit for Dynamic Product Label Print diff --git a/dynamic_product_label_print/models/__init__.py b/dynamic_product_label_print/models/__init__.py new file mode 100644 index 000000000..1e2e3451f --- /dev/null +++ b/dynamic_product_label_print/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 . import dynamic_fields +from . import dynamic_template diff --git a/dynamic_product_label_print/models/dynamic_fields.py b/dynamic_product_label_print/models/dynamic_fields.py new file mode 100644 index 000000000..d3c367c87 --- /dev/null +++ b/dynamic_product_label_print/models/dynamic_fields.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 fields, models + + +class DynamicFields(models.Model): + """One2many fields of dynamic template""" + _name = "dynamic.fields" + _description = "Dynamic Fields" + + def set_domain(self): + """Fields of the product model""" + model_id = self.env['ir.model'].sudo().search( + [('model', '=', 'product.product')]) + return [('model_id', '=', model_id.id), ('state', '=', 'base'), ( + 'name', '=', + ['name', 'categ_id', 'type', 'list_price'])] + + size = fields.Char(string='Font Size', help="Set the size of the field") + color = fields.Char(string='Font Color', help="Set the colour of the field") + fd_name_id = fields.Many2one('ir.model.fields', string='Field Name', + domain=set_domain, help='Name of the field') + type = fields.Selection(string='Type', related='fd_name_id.ttype', + help='Type of the field name') + field_id = fields.Many2one('dynamic.template', string='Fields', + help='Relation from dynamic templates') diff --git a/dynamic_product_label_print/models/dynamic_template.py b/dynamic_product_label_print/models/dynamic_template.py new file mode 100644 index 000000000..14194f081 --- /dev/null +++ b/dynamic_product_label_print/models/dynamic_template.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 fields, models + + +class DynamicTemplate(models.Model): + """Dynamic template for Products""" + _name = "dynamic.template" + _description = 'Dynamic Template' + + name = fields.Char(string='Name', required=True, + help='Name of the template') + bc_height = fields.Char(string='Barcode Height', required=True, + help='Height of the barcode') + bc_width = fields.Char(string='Barcode width', required=True, + help='Width of the barcode') + dynamic_field_ids = fields.One2many('dynamic.fields', 'field_id', + string='Fields', + help='You can select the required field ' + 'from the product with required ' + 'size and color for viewing in the ' + 'label report') diff --git a/dynamic_product_label_print/report/__init__.py b/dynamic_product_label_print/report/__init__.py new file mode 100644 index 000000000..b526f2302 --- /dev/null +++ b/dynamic_product_label_print/report/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 . import product_barcode_report diff --git a/dynamic_product_label_print/report/label_layout_templates.xml b/dynamic_product_label_print/report/label_layout_templates.xml new file mode 100644 index 000000000..4b6ad4dcc --- /dev/null +++ b/dynamic_product_label_print/report/label_layout_templates.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + Product Label (PDF) + product.template + qweb-pdf + dynamic_product_label_print.report_dynamic + dynamic_product_label_print.report_dynamic + + 'Products Labels - %s' % + (object.name) + + + report + + diff --git a/dynamic_product_label_print/report/product_barcode_report.py b/dynamic_product_label_print/report/product_barcode_report.py new file mode 100644 index 000000000..269d2dd4d --- /dev/null +++ b/dynamic_product_label_print/report/product_barcode_report.py @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 collections import defaultdict +from odoo import models, _ +from odoo.exceptions import UserError + + +def _prepare_datas(env, data): + """ + Change product ids by actual product object to get access to fields in xml + template we need to pass ids because reports only accepts native python + types (int, float, strings, ...) + """ + if data.get('active_model') == 'product.template': + Product = env['product.template'].with_context( + display_default_code=False) + elif data.get('active_model') == 'product.product': + Product = env['product.product'].with_context( + display_default_code=False) + else: + raise UserError(_('Product model not defined, Please contact your administrator.')) + + total = 0 + quantity_by_product = defaultdict(list) + for product_qty, qnty in data.get('quantity_by_product').items(): + product = Product.browse(int(product_qty)) + quantity_by_product[product].append((product.barcode, qnty, product.name, + product.categ_id.name, + product.type, + product.list_price)) + total += qnty + if data.get('custom_barcodes'): + # We expect custom barcodes format as: {product: [(barcode, qty_of_barcode)]} + for product, barcodes_qtys in data.get('custom_barcodes').items(): + quantity_by_product[Product.browse(int(product))] += (barcodes_qtys) + total += sum(qty for _, qty in barcodes_qtys) + return { + 'quantity': quantity_by_product, + } + + +class ReportProductTemplateLabelDynamic(models.AbstractModel): + """Product Dynamic Report""" + _name = 'report.dynamic_product_label_print.report_dynamic' + _description = 'Product Dynamic Report' + + def _get_report_values(self, docids, data): + """ + override the method to create custom report with custom values + :param docids: the recordset/ record from which the report action is + invoked + :param data: report data + :return: data and recordsets to be used in the report template + """ + return _prepare_datas(self.env, data) diff --git a/dynamic_product_label_print/security/ir.model.access.csv b/dynamic_product_label_print/security/ir.model.access.csv new file mode 100644 index 000000000..85ced2b88 --- /dev/null +++ b/dynamic_product_label_print/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_dynamic_template_user,access.dynamic.template.user,model_dynamic_template,base.group_user,1,1,1,1 +access_dynamic_fields_user,access.dynamic.fields.user,model_dynamic_fields,base.group_user,1,1,1,1 diff --git a/dynamic_product_label_print/static/description/assets/cybro-icon.png b/dynamic_product_label_print/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/cybro-icon.png differ diff --git a/dynamic_product_label_print/static/description/assets/cybro-odoo.png b/dynamic_product_label_print/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/cybro-odoo.png differ diff --git a/dynamic_product_label_print/static/description/assets/h2.png b/dynamic_product_label_print/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/h2.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/arrows-repeat.svg b/dynamic_product_label_print/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-1.png b/dynamic_product_label_print/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/banner-1.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-2.svg b/dynamic_product_label_print/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-bg.png b/dynamic_product_label_print/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/banner-bg.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-bg.svg b/dynamic_product_label_print/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-call.svg b/dynamic_product_label_print/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-mail.svg b/dynamic_product_label_print/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-pattern.svg b/dynamic_product_label_print/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/banner-promo.svg b/dynamic_product_label_print/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/brand-pair.svg b/dynamic_product_label_print/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/check.png b/dynamic_product_label_print/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/check.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/chevron.png b/dynamic_product_label_print/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/chevron.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/close-icon.svg b/dynamic_product_label_print/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/cogs.png b/dynamic_product_label_print/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/cogs.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/collabarate-icon.svg b/dynamic_product_label_print/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/consultation.png b/dynamic_product_label_print/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/consultation.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/cybro-logo.png b/dynamic_product_label_print/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/cybro-logo.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/down.svg b/dynamic_product_label_print/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dynamic_product_label_print/static/description/assets/icons/ecom-black.png b/dynamic_product_label_print/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/ecom-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/education-black.png b/dynamic_product_label_print/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/education-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/faq.png b/dynamic_product_label_print/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/faq.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/feature-icon.svg b/dynamic_product_label_print/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/feature.png b/dynamic_product_label_print/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/feature.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/gear.svg b/dynamic_product_label_print/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/hero.gif b/dynamic_product_label_print/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/hero.gif differ diff --git a/dynamic_product_label_print/static/description/assets/icons/hire-odoo.svg b/dynamic_product_label_print/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/hotel-black.png b/dynamic_product_label_print/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/hotel-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/license.png b/dynamic_product_label_print/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/license.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/life-ring-icon.svg b/dynamic_product_label_print/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/lifebuoy.png b/dynamic_product_label_print/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/lifebuoy.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/mail.svg b/dynamic_product_label_print/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/manufacturing-black.png b/dynamic_product_label_print/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/manufacturing-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/notes.png b/dynamic_product_label_print/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/notes.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/notification icon.svg b/dynamic_product_label_print/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/odoo-consultancy.svg b/dynamic_product_label_print/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/odoo-licencing.svg b/dynamic_product_label_print/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/odoo-logo.png b/dynamic_product_label_print/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/odoo-logo.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/patter.svg b/dynamic_product_label_print/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/pattern1.png b/dynamic_product_label_print/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/pattern1.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/pos-black.png b/dynamic_product_label_print/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/pos-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/puzzle-piece-icon.svg b/dynamic_product_label_print/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/puzzle.png b/dynamic_product_label_print/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/puzzle.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/replace-icon.svg b/dynamic_product_label_print/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/restaurant-black.png b/dynamic_product_label_print/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/restaurant-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/screenshot-main.png b/dynamic_product_label_print/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/screenshot-main.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/screenshot.png b/dynamic_product_label_print/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/screenshot.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/service-black.png b/dynamic_product_label_print/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/service-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/skype-fill.svg b/dynamic_product_label_print/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/skype.png b/dynamic_product_label_print/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/skype.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/skype.svg b/dynamic_product_label_print/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/star-1.svg b/dynamic_product_label_print/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/star-2.svg b/dynamic_product_label_print/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/support.png b/dynamic_product_label_print/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/support.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/test-1 - Copy.png b/dynamic_product_label_print/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/test-1 - Copy.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/test-1.png b/dynamic_product_label_print/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/test-1.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/test-2.png b/dynamic_product_label_print/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/test-2.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/trading-black.png b/dynamic_product_label_print/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/trading-black.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/training.png b/dynamic_product_label_print/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/training.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/translate.svg b/dynamic_product_label_print/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/update.png b/dynamic_product_label_print/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/update.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/user.png b/dynamic_product_label_print/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/user.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/video.png b/dynamic_product_label_print/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/video.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/whatsapp.png b/dynamic_product_label_print/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/whatsapp.png differ diff --git a/dynamic_product_label_print/static/description/assets/icons/wrench-icon.svg b/dynamic_product_label_print/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/dynamic_product_label_print/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dynamic_product_label_print/static/description/assets/icons/wrench.png b/dynamic_product_label_print/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/icons/wrench.png differ diff --git a/dynamic_product_label_print/static/description/assets/modules/courier_management.jpg b/dynamic_product_label_print/static/description/assets/modules/courier_management.jpg new file mode 100644 index 000000000..3e4a22c32 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/courier_management.jpg differ diff --git a/dynamic_product_label_print/static/description/assets/modules/cw_sale.png b/dynamic_product_label_print/static/description/assets/modules/cw_sale.png new file mode 100644 index 000000000..1b75c62d5 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/cw_sale.png differ diff --git a/dynamic_product_label_print/static/description/assets/modules/cw_stock.png b/dynamic_product_label_print/static/description/assets/modules/cw_stock.png new file mode 100644 index 000000000..62af09ec6 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/cw_stock.png differ diff --git a/dynamic_product_label_print/static/description/assets/modules/delivery_split.jpg b/dynamic_product_label_print/static/description/assets/modules/delivery_split.jpg new file mode 100644 index 000000000..76724ebda Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/delivery_split.jpg differ diff --git a/dynamic_product_label_print/static/description/assets/modules/multi_product_return_from_website.jpg b/dynamic_product_label_print/static/description/assets/modules/multi_product_return_from_website.jpg new file mode 100644 index 000000000..7f2cc2ab5 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/multi_product_return_from_website.jpg differ diff --git a/dynamic_product_label_print/static/description/assets/modules/purchase_history_of_product.jpg b/dynamic_product_label_print/static/description/assets/modules/purchase_history_of_product.jpg new file mode 100644 index 000000000..dab7b184c Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/modules/purchase_history_of_product.jpg differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/1-1.png b/dynamic_product_label_print/static/description/assets/screenshots/1-1.png new file mode 100644 index 000000000..4896c9547 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/1-1.png differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/1.png b/dynamic_product_label_print/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..4a3f7d4cb Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/1.png differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/2.png b/dynamic_product_label_print/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..b9e04aec4 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/2.png differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/3.png b/dynamic_product_label_print/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..689a77345 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/3.png differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/4.png b/dynamic_product_label_print/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..8f28b5fbf Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/4.png differ diff --git a/dynamic_product_label_print/static/description/assets/screenshots/GIF.gif b/dynamic_product_label_print/static/description/assets/screenshots/GIF.gif new file mode 100644 index 000000000..5e3b96aed Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/screenshots/GIF.gif differ diff --git a/dynamic_product_label_print/static/description/assets/y18.jpg b/dynamic_product_label_print/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/dynamic_product_label_print/static/description/assets/y18.jpg differ diff --git a/dynamic_product_label_print/static/description/banner.jpg b/dynamic_product_label_print/static/description/banner.jpg new file mode 100644 index 000000000..b4622291a Binary files /dev/null and b/dynamic_product_label_print/static/description/banner.jpg differ diff --git a/dynamic_product_label_print/static/description/icon.png b/dynamic_product_label_print/static/description/icon.png new file mode 100644 index 000000000..9d356ce67 Binary files /dev/null and b/dynamic_product_label_print/static/description/icon.png differ diff --git a/dynamic_product_label_print/static/description/index.html b/dynamic_product_label_print/static/description/index.html new file mode 100644 index 000000000..e50b7cc3f --- /dev/null +++ b/dynamic_product_label_print/static/description/index.html @@ -0,0 +1,995 @@ + + + + + + Dynamic Product Label Print + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ This App Helps to Print the Barcode or Label With Dynamic Fields By One Click. +

+

Dynamic Product Label Print +

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

Key + Highlights

+
+
+
+
+ +
+
+ Possible to print required quantity the barcode +
+

+

+
+
+
+
+
+ +
+
+ Provides to print the barcode of multiple product +
+

+ +

+
+
+
+
+
+ +
+
+ Select the required fields that you want to print with barcode +
+

+ +

+
+
+ +
+
+ +
+
+
+ Dynamic Product Label Print +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Dynamic Product + + Print Label Template +

+
+
+

+ You can create the Dynamic Product Template for the barcode from here. +

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

+ Create + Design +

+
+
+

+ Here we can set the size of barcode and label then also + select the required field that need to print with the barcode. + Here during the selection of fields you can set the colour and size of the fields. +

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

+ Print Label + +

+
+
+

+ From the 'Print Label' Button of Products you can see one more option 'Dynamic Templates'

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

+ Select + Design Template +

+
+
+

+ You can select the required template after + enable the Dynamic Template with required quantity

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

+ Print + Label +

+
+
+

+ Dynamic Product Label +

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

+ It is possible to print the required quantity of barcodes.

+
+ +
+
+
+
+
+
+ +
+

+ Allows printing barcodes for multiple products.

+
+
+
+
+
+
+
+ +
+

+ Define the size(px) of barcode and label from the template. +

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

+ This app allows users to print barcodes or labels with dynamic fields quickly and easily, all with just one click. +

+
+
+ +
+ +
+

+ Simply select your template, enter the required data into the dynamic fields, and click the print button. The app will generate the barcode or label for you. +

+
+
+ +
+ +
+

+ Yes, the app allows you to upload and customize your own templates to suit your specific labeling needs. +

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

+ Latest Release 18.0.1.0.0 +

+ + 7th October, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/dynamic_product_label_print/views/dynamic_template_views.xml b/dynamic_product_label_print/views/dynamic_template_views.xml new file mode 100644 index 000000000..83ec4d485 --- /dev/null +++ b/dynamic_product_label_print/views/dynamic_template_views.xml @@ -0,0 +1,47 @@ + + + + + dynamic.template.view.form + dynamic.template + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + Dynamic Label Template + dynamic.template + list,form + + + +
diff --git a/dynamic_product_label_print/wizard/__init__.py b/dynamic_product_label_print/wizard/__init__.py new file mode 100644 index 000000000..5cf013502 --- /dev/null +++ b/dynamic_product_label_print/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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 . import product_label_layout diff --git a/dynamic_product_label_print/wizard/product_label_layout.py b/dynamic_product_label_print/wizard/product_label_layout.py new file mode 100644 index 000000000..62c31b3ef --- /dev/null +++ b/dynamic_product_label_print/wizard/product_label_layout.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Ammu Raj () + +# 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, fields, models, _ +from odoo.exceptions import UserError + + +class ProductLabelLayout(models.TransientModel): + """Inherited the product label layout wizard for adding new feature + Dynamic templates""" + _inherit = 'product.label.layout' + + print_format = fields.Selection( + selection_add=[('dynamic_template', 'Dynamic Template'), ], + ondelete={'dynamic_template': 'set default'}, + help="Added new selection for choosing dynamic template") + dynamic_template_id = fields.Many2one('dynamic.template', + help="Select the required template") + dynamic_field_ids = fields.Many2many('dynamic.fields', + 'dynamic_field_rel', + help='Relation to dynamic fields') + + @api.onchange('dynamic_template_id') + def _onchange_dynamic_template_id(self): + """Passing the values from the template to wizard""" + self.dynamic_field_ids = self.dynamic_template_id.dynamic_field_ids + + def _prepare_report_data(self): + """Passing the datas to template""" + xml_id, data = super()._prepare_report_data() + if 'dynamic_template' in self.print_format: + xml_id = 'dynamic_product_label_print.product_label_layout_form_dynamic' + active_model = '' + if self.product_tmpl_ids: + products = self.product_tmpl_ids.ids + active_model = 'product.template' + elif self.product_ids: + products = self.product_ids.ids + active_model = 'product.product' + dynamic_field_ids = [] + if self.product_ids: + dynamic_dict = [ + {'fields': self.product_ids.read([i.fd_name_id.name]), + 'size': i.size, + 'color': i.color} for i in self.dynamic_field_ids] + else: + dynamic_dict = [ + {'fields': self.product_tmpl_ids.read([i.fd_name_id.name]), + 'size': i.size, + 'color': i.color} for i in self.dynamic_field_ids] + dynamic_field_ids.append(dynamic_dict) + data = { + 'active_model': active_model, + 'quantity_by_product': {p: self.custom_quantity for p in + products}, + 'layout_wizard': self.dynamic_template_id, + 'bc_width': self.dynamic_template_id.bc_width, + 'bc_height': self.dynamic_template_id.bc_height, + 'dynamic_field_ids': dynamic_field_ids, + } + return xml_id, data + + def process(self): + """Returning the report action process for printing the label""" + action = super(ProductLabelLayout, self).process() + self.ensure_one() + xml_id, data = self._prepare_report_data() + if not xml_id: + raise UserError(_('Unable to find report template for %s format')) + report_action = self.env.ref(xml_id).report_action(None, data=data) + report_action.update({'close_on_report_download': True}) + return action diff --git a/dynamic_product_label_print/wizard/product_label_layout_views.xml b/dynamic_product_label_print/wizard/product_label_layout_views.xml new file mode 100644 index 000000000..f15bbe482 --- /dev/null +++ b/dynamic_product_label_print/wizard/product_label_layout_views.xml @@ -0,0 +1,20 @@ + + + + + + product.label.layout.view.form.inherit.dynamic.product.label.print + + product.label.layout + form + + + + + + + + +