diff --git a/customized_barcode_generator/README.rst b/customized_barcode_generator/README.rst new file mode 100644 index 000000000..6dd0a8875 --- /dev/null +++ b/customized_barcode_generator/README.rst @@ -0,0 +1,15 @@ +Cost Price as Code in Barcode v14 +================================= + + The module enables user to print customized product labels. + +Installation +============ + - www.odoo.com/documentation/14.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 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..b318aa99a --- /dev/null +++ b/customized_barcode_generator/__manifest__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +{ + 'name': 'Cost Price as Code in Barcode', + 'version': '14.0.1.0.0', + 'summary': """Print user defined product labels.""", + 'description': """The module enables user to print customized product labels. + """, + '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..8b01f18b3 --- /dev/null +++ b/customized_barcode_generator/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 09.10.2020 +#### Version 14.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..87dcec564 --- /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.product' + cost_in_code = fields.Char(string='Cost in code', compute='get_cost_in_code') + + + 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..eaccbb0bb --- /dev/null +++ b/customized_barcode_generator/report/product_label_template.xml @@ -0,0 +1,43 @@ + + + + + + \ 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/banner.png b/customized_barcode_generator/static/description/banner.png new file mode 100644 index 000000000..2b44e90cf 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..6431fc139 Binary files /dev/null and b/customized_barcode_generator/static/description/icon.png differ diff --git a/customized_barcode_generator/static/description/images/1barcode.png b/customized_barcode_generator/static/description/images/1barcode.png new file mode 100644 index 000000000..8ce169b5d Binary files /dev/null and b/customized_barcode_generator/static/description/images/1barcode.png differ diff --git a/customized_barcode_generator/static/description/images/2barcode.png b/customized_barcode_generator/static/description/images/2barcode.png new file mode 100644 index 000000000..1da29dab4 Binary files /dev/null and b/customized_barcode_generator/static/description/images/2barcode.png differ diff --git a/customized_barcode_generator/static/description/images/3barcode.png b/customized_barcode_generator/static/description/images/3barcode.png new file mode 100644 index 000000000..d1cdc19cb Binary files /dev/null and b/customized_barcode_generator/static/description/images/3barcode.png differ diff --git a/customized_barcode_generator/static/description/images/4barcode.png b/customized_barcode_generator/static/description/images/4barcode.png new file mode 100644 index 000000000..1386dd42d Binary files /dev/null and b/customized_barcode_generator/static/description/images/4barcode.png differ diff --git a/customized_barcode_generator/static/description/images/5barcode.png b/customized_barcode_generator/static/description/images/5barcode.png new file mode 100644 index 000000000..eb0eeecc1 Binary files /dev/null and b/customized_barcode_generator/static/description/images/5barcode.png differ diff --git a/customized_barcode_generator/static/description/images/banner_lifeline_for_task.jpeg b/customized_barcode_generator/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/customized_barcode_generator/static/description/images/banner_project_report_xls_pdf.png b/customized_barcode_generator/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/customized_barcode_generator/static/description/images/banner_project_status_report.png b/customized_barcode_generator/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_project_status_report.png differ diff --git a/customized_barcode_generator/static/description/images/banner_subtask.jpeg b/customized_barcode_generator/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_subtask.jpeg differ diff --git a/customized_barcode_generator/static/description/images/banner_task_deadline_reminder.jpeg b/customized_barcode_generator/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/customized_barcode_generator/static/description/images/banner_task_statusbar.jpeg b/customized_barcode_generator/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/customized_barcode_generator/static/description/images/banner_task_statusbar.jpeg differ diff --git a/customized_barcode_generator/static/description/images/barcode.png b/customized_barcode_generator/static/description/images/barcode.png new file mode 100644 index 000000000..0a9a9ceae Binary files /dev/null and b/customized_barcode_generator/static/description/images/barcode.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..578cedb80 Binary files /dev/null and b/customized_barcode_generator/static/description/images/checked.png differ diff --git a/customized_barcode_generator/static/description/images/cybrosys.png b/customized_barcode_generator/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/customized_barcode_generator/static/description/images/cybrosys.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..455c02246 --- /dev/null +++ b/customized_barcode_generator/static/description/index.html @@ -0,0 +1,319 @@ +
cybrosys-logo
+
+
+
+

Customized Barcode Generator

+

Print user defined product labels.

+
+

Key Highlights

+
    +
  • 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.
  • + +
+
+
+
+ +
+
+
+
+ +
+
+ +

Overview

+
+

+ The module enables user to print customized product labels.

+
+
+ +

Customized Barcode Generator

+
+
    +
  • + 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

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+
+ +
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ 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..e039181e9 --- /dev/null +++ b/customized_barcode_generator/views/barcode_generator_view.xml @@ -0,0 +1,87 @@ + + + + + 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