diff --git a/customized_barcode_generator/README.rst b/customized_barcode_generator/README.rst new file mode 100644 index 000000000..6008d50ad --- /dev/null +++ b/customized_barcode_generator/README.rst @@ -0,0 +1,16 @@ +Cost Price as Code in Barcode v15 +================================= + + The module enables user to print customized product labels. + +Installation +============ + - www.odoo.com/documentation/15.0/setup/install.html + - Install our custom addon + +Credits +======= + Developer: Atul Ramesh Varma @ cybrosys, Contact: odoo@cybrosys.com + V13 : Sreenath. + V14 : Minhaj T @cybrosys, Contact: odoo@cybrosys.com + V15 : Mekha K @cybrosys, Contact: odoo@cybrosys.com diff --git a/customized_barcode_generator/__init__.py b/customized_barcode_generator/__init__.py new file mode 100644 index 000000000..4fcf7385c --- /dev/null +++ b/customized_barcode_generator/__init__.py @@ -0,0 +1,2 @@ +from . import report +from . import models \ No newline at end of file diff --git a/customized_barcode_generator/__manifest__.py b/customized_barcode_generator/__manifest__.py new file mode 100644 index 000000000..4d8157347 --- /dev/null +++ b/customized_barcode_generator/__manifest__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +{ + 'name': 'Cost Price as Code in Barcode', + 'version': '15.0.1.0.0', + 'summary': """Print user defined product labels.""", + 'description': """The module enables user to print customized product labels, Barcode, Barcode Generator, Barcode Label, Product Label, Product Barcode Generator, Product Barcode, Label Print, Product Label Print + """, + 'category': 'Tools', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['base', 'web', 'product', 'account'], + 'website': 'https://www.cybrosys.com', + 'data': [ + 'report/product_label_template.xml', + 'views/barcode_generator_view.xml', + 'security/ir.model.access.csv' + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/customized_barcode_generator/doc/RELEASE_NOTES.md b/customized_barcode_generator/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e95c86033 --- /dev/null +++ b/customized_barcode_generator/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.10.2021 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Customized Barcode Generator diff --git a/customized_barcode_generator/models/__init__.py b/customized_barcode_generator/models/__init__.py new file mode 100644 index 000000000..1116085dc --- /dev/null +++ b/customized_barcode_generator/models/__init__.py @@ -0,0 +1 @@ +from . import barcode_generator \ No newline at end of file diff --git a/customized_barcode_generator/models/barcode_generator.py b/customized_barcode_generator/models/barcode_generator.py new file mode 100644 index 000000000..4900b99ec --- /dev/null +++ b/customized_barcode_generator/models/barcode_generator.py @@ -0,0 +1,113 @@ +from odoo import api, fields, models, _ +import datetime +from odoo.exceptions import UserError + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + active_standard_price = fields.Boolean(string='Standard price as a code', + help="check this box to show cost on the product labels as code") + active_ref = fields.Boolean(string='Show product reference ', + help="check this box to show product reference as in product labels") + + @api.model + def get_values(self): + res = super(ResConfigSettings, self).get_values() + params = self.env['ir.config_parameter'].sudo() + active_standard_price = params.get_param('active_standard_price', default=False) + active_ref = params.get_param('active_ref', default=False) + res.update( + active_standard_price=bool(active_standard_price), + active_ref=bool(active_ref), + ) + return res + + + def set_values(self): + super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param("active_standard_price", + self.active_standard_price) + self.env['ir.config_parameter'].sudo().set_param("active_ref", + self.active_ref) + + +class CustomizeBarcodeGenerator(models.Model): + _name = 'barcode.code' + name = fields.Char(default='Numeric Code') + code_for_zero = fields.Char(string=' 0 ', required=True, limit=1, size=1, + default='a', help="insert substitute code ") + code_for_one = fields.Char(string='1 ', required=True, limit=1, size=1, + default='b', help="insert substitute code ") + code_for_two = fields.Char(string='2 ', required=True, limit=1, size=1, + default='c', help="insert substitute code ") + code_for_three = fields.Char(string='3 ', required=True, limit=1, size=1, + default='d', help="insert substitute code ") + code_for_four = fields.Char(string='4 ', required=True, limit=1, size=1, + default='e', help="insert substitute code ") + code_for_five = fields.Char(string='5 ', required=True, limit=1, size=1, + default='f', help="insert substitute code ") + code_for_six = fields.Char(string='6 ', required=True, limit=1, size=1, + default='g', help="insert substitute code ") + code_for_seven = fields.Char(string='7 ', required=True, limit=1, size=1, + default='h', help="insert substitute code ") + code_for_eight = fields.Char(string='8 ', required=True, limit=1, size=1, + default='i', help="insert substitute code ") + code_for_nine = fields.Char(string='9 ', required=True, limit=1, size=1, + default='j', help="insert substitute code ") + active_check = fields.Boolean(string="Active", default=False) + date_check = fields.Datetime(default=datetime.datetime.today(), string="Date") + + + @api.onchange('active_check') + def onchange_active_check(self): + for i in self.search([]): + if i.active_check == self.active_check and self.active_check: + self.active_check = False + raise UserError(_("Only one rule for code can be active at a time")) + + +class CostToCode(models.Model): + _inherit = 'product.template' + cost_in_code = fields.Char(string='Cost in code', compute='get_cost_in_code') + + @api.depends('standard_price') + def get_cost_in_code(self): + code = self.env['barcode.code'].sudo().search([('active_check', '=', True)]) + active_check = self.env['ir.config_parameter'].sudo().search([('key','=','active_standard_price'),('value','=',True)]) + if active_check: + if code: + real = str(self.standard_price).split('.')[0] + for i in real: + if i == '0': + real = real.replace('0', code.code_for_zero) + elif i == '1': + real = real.replace('1', code.code_for_one) + elif i == '2': + real = real.replace('2', code.code_for_two) + elif i == '3': + real = real.replace('3', code.code_for_three) + elif i == '4': + real = real.replace('4', code.code_for_four) + elif i == '5': + real = real.replace('5', code.code_for_five) + elif i == '6': + real = real.replace('6', code.code_for_six) + elif i == '7': + real = real.replace('7', code.code_for_seven) + elif i == '8': + real = real.replace('8', code.code_for_eight) + else: + real = real.replace('9', code.code_for_nine) + return real + else: + return " " + else: + return " " + + def get_product_ref(self): + active_check = self.env['ir.config_parameter'].sudo().search([('key','=','active_ref'),('value','=',True)]) + if active_check: + return self.default_code + else: + return " " diff --git a/customized_barcode_generator/report/__init__.py b/customized_barcode_generator/report/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/customized_barcode_generator/report/product_label_template.xml b/customized_barcode_generator/report/product_label_template.xml new file mode 100644 index 000000000..ddfe75318 --- /dev/null +++ b/customized_barcode_generator/report/product_label_template.xml @@ -0,0 +1,153 @@ + + + + + + + + + + \ No newline at end of file diff --git a/customized_barcode_generator/security/ir.model.access.csv b/customized_barcode_generator/security/ir.model.access.csv new file mode 100644 index 000000000..947b82bf7 --- /dev/null +++ b/customized_barcode_generator/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_customized_barcode_generator,customized.barcode.generator.user,model_barcode_code,account.group_account_manager,1,1,1,1 \ No newline at end of file diff --git a/customized_barcode_generator/static/description/assets/icons/chevron.png b/customized_barcode_generator/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/chevron.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/cogs.png b/customized_barcode_generator/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/cogs.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/consultation.png b/customized_barcode_generator/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/consultation.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/ecom-black.png b/customized_barcode_generator/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/ecom-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/education-black.png b/customized_barcode_generator/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/education-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/hotel-black.png b/customized_barcode_generator/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/hotel-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/license.png b/customized_barcode_generator/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/license.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/lifebuoy.png b/customized_barcode_generator/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/lifebuoy.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/manufacturing-black.png b/customized_barcode_generator/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/manufacturing-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/pos-black.png b/customized_barcode_generator/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/pos-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/puzzle.png b/customized_barcode_generator/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/puzzle.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/restaurant-black.png b/customized_barcode_generator/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/restaurant-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/service-black.png b/customized_barcode_generator/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/service-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/trading-black.png b/customized_barcode_generator/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/trading-black.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/training.png b/customized_barcode_generator/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/training.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/update.png b/customized_barcode_generator/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/update.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/user.png b/customized_barcode_generator/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/user.png differ diff --git a/customized_barcode_generator/static/description/assets/icons/wrench.png b/customized_barcode_generator/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/customized_barcode_generator/static/description/assets/icons/wrench.png differ diff --git a/customized_barcode_generator/static/description/banner.png b/customized_barcode_generator/static/description/banner.png new file mode 100644 index 000000000..2b3b17b07 Binary files /dev/null and b/customized_barcode_generator/static/description/banner.png differ diff --git a/customized_barcode_generator/static/description/icon.png b/customized_barcode_generator/static/description/icon.png new file mode 100644 index 000000000..5aa7293e9 Binary files /dev/null and b/customized_barcode_generator/static/description/icon.png differ diff --git a/customized_barcode_generator/static/description/images/checked.png b/customized_barcode_generator/static/description/images/checked.png new file mode 100644 index 000000000..e6c63d582 Binary files /dev/null and b/customized_barcode_generator/static/description/images/checked.png differ diff --git a/customized_barcode_generator/static/description/images/hero.png b/customized_barcode_generator/static/description/images/hero.png new file mode 100644 index 000000000..89a214aa7 Binary files /dev/null and b/customized_barcode_generator/static/description/images/hero.png differ diff --git a/customized_barcode_generator/static/description/images/modules/approval_image.png b/customized_barcode_generator/static/description/images/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/customized_barcode_generator/static/description/images/modules/approval_image.png differ diff --git a/customized_barcode_generator/static/description/images/modules/dynamic_image.png b/customized_barcode_generator/static/description/images/modules/dynamic_image.png new file mode 100644 index 000000000..74ce220e6 Binary files /dev/null and b/customized_barcode_generator/static/description/images/modules/dynamic_image.png differ diff --git a/customized_barcode_generator/static/description/images/modules/mulitple-ref_image.png b/customized_barcode_generator/static/description/images/modules/mulitple-ref_image.png new file mode 100644 index 000000000..e0964f1e3 Binary files /dev/null and b/customized_barcode_generator/static/description/images/modules/mulitple-ref_image.png differ diff --git a/customized_barcode_generator/static/description/images/modules/pos_image.png b/customized_barcode_generator/static/description/images/modules/pos_image.png new file mode 100644 index 000000000..c5932894b Binary files /dev/null and b/customized_barcode_generator/static/description/images/modules/pos_image.png differ diff --git a/customized_barcode_generator/static/description/images/modules/shopify_image.png b/customized_barcode_generator/static/description/images/modules/shopify_image.png new file mode 100644 index 000000000..c6d92c16d Binary files /dev/null and b/customized_barcode_generator/static/description/images/modules/shopify_image.png differ diff --git a/customized_barcode_generator/static/description/images/screenshots/1barcode.png b/customized_barcode_generator/static/description/images/screenshots/1barcode.png new file mode 100644 index 000000000..29a2a5a50 Binary files /dev/null and b/customized_barcode_generator/static/description/images/screenshots/1barcode.png differ diff --git a/customized_barcode_generator/static/description/images/screenshots/2barcode.png b/customized_barcode_generator/static/description/images/screenshots/2barcode.png new file mode 100644 index 000000000..6a38d147b Binary files /dev/null and b/customized_barcode_generator/static/description/images/screenshots/2barcode.png differ diff --git a/customized_barcode_generator/static/description/images/screenshots/3barcode.png b/customized_barcode_generator/static/description/images/screenshots/3barcode.png new file mode 100644 index 000000000..c868b823a Binary files /dev/null and b/customized_barcode_generator/static/description/images/screenshots/3barcode.png differ diff --git a/customized_barcode_generator/static/description/images/screenshots/4barcode.png b/customized_barcode_generator/static/description/images/screenshots/4barcode.png new file mode 100644 index 000000000..7771c3e8e Binary files /dev/null and b/customized_barcode_generator/static/description/images/screenshots/4barcode.png differ diff --git a/customized_barcode_generator/static/description/images/screenshots/5barcode.png b/customized_barcode_generator/static/description/images/screenshots/5barcode.png new file mode 100644 index 000000000..d87b1bbf4 Binary files /dev/null and b/customized_barcode_generator/static/description/images/screenshots/5barcode.png differ diff --git a/customized_barcode_generator/static/description/index.html b/customized_barcode_generator/static/description/index.html new file mode 100644 index 000000000..ceb613e39 --- /dev/null +++ b/customized_barcode_generator/static/description/index.html @@ -0,0 +1,579 @@ +
+
+ +
+
+

Customized Barcode Generator

+

+ Print user defined product labels.

+ +
+
+ + + +
+
+

Overview

+
+

+ The module enables user to print customized product labels. +

+
+
+ + + + +
+
+

Key Features

+
+
+ + +
+ +
+ +

+ Create custom code for printing standard price on product labels. +

+
+ +
+ +

+ Show/hide product reference on product labels. +

+
+ +
+ +

+ Show/hide cost price as a code on product labels. +

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

Screenshots

+
+ + +
+
+

+ 01

+
+
+

+ Go to Invoicing --> Settings +

+

+ Select whether to show/hide standard price as code or product reference on product + labels and click Save. +

+
+
+ + + + +
+
+

+ 02

+
+
+

+ Go to Invoicing --> Settings --> Product Labels +

+

+ Click on barcode code to create a new rules. +

+ +
+
+ + + + +
+
+

+ 03

+
+
+

+ Set codes for each digits. +

+

+ In the form view, you can set the code for each digit. Click on the active button to use + this rule on the product label. +

+ +
+
+ + + + +
+
+

+ 04

+
+
+

+ Printing the labels +

+

+ Go to Products view select products and print product labels as shown below. +

+ +
+
+ + + + +
+
+

+ 05

+
+
+

+ Labels with standard price of products and product reference +

+

+ You can see the standard price of products on the bottom right of product label as code + using the active rule, and at the bottom left you can see the product reference. +

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

Suggested Products

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

Our Services

+
+
+ +
+
+ +
+
Odoo + Customization
+
+ +
+
+ +
+
Odoo + Implementation
+
+ +
+
+ +
+
Odoo + Support
+
+ + +
+
+ +
+
Hire + Odoo + Developer
+
+ +
+
+ +
+
Odoo + Integration
+
+ +
+
+ +
+
Odoo + Migration
+
+ + +
+
+ +
+
Odoo + Consultancy
+
+ +
+
+ +
+
Odoo + Implementation
+
+ +
+
+ +
+
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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + +
+
\ No newline at end of file diff --git a/customized_barcode_generator/views/barcode_generator_view.xml b/customized_barcode_generator/views/barcode_generator_view.xml new file mode 100644 index 000000000..708351f80 --- /dev/null +++ b/customized_barcode_generator/views/barcode_generator_view.xml @@ -0,0 +1,88 @@ + + + + + barcode.code.form.view + barcode.code + form + +
+ + +
+
+
+ + barcode.code.tree.view + barcode.code + tree + + + + + + + + + + + Barcode Code + barcode.code + tree,form + +

Create new code +

+
+
+ + + res.config.settings.view.form.customize.barcode + res.config.settings + + + + +

Product Labels

+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
\ No newline at end of file