diff --git a/transliterate_widget/README.rst b/transliterate_widget/README.rst new file mode 100644 index 000000000..6fd048961 --- /dev/null +++ b/transliterate_widget/README.rst @@ -0,0 +1,28 @@ +TRANSLITERATE WIDGET +==================== +Transliterate widget for Odoo client + +Credits +======= +Credits for https://www.google.com/jsapi +Developer: Varsha Vivek K @ cybrosys, Contact: odoo@cybrosys.com + +Usage +===== + +You need to declare a char field. + + transliterate = fields.Char(string="Transliterate") + +In the view declaration, + ... + +
+ ... + + ... + +
+ ... + + diff --git a/transliterate_widget/__init__.py b/transliterate_widget/__init__.py new file mode 100644 index 000000000..43a01194b --- /dev/null +++ b/transliterate_widget/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models + diff --git a/transliterate_widget/__manifest__.py b/transliterate_widget/__manifest__.py new file mode 100644 index 000000000..da8c0c1a2 --- /dev/null +++ b/transliterate_widget/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Transliterate Widget', + 'version': '13.0.1.0.0', + 'summary': 'Widget for translation', + 'description': 'Widget for translation', + 'category': 'Tools', + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base_setup'], + 'data': ['view/assets.xml', + 'view/res_config_settings_view.xml'], + 'qweb': ['static/src/xml/transliterate_widget.xml'], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} \ No newline at end of file diff --git a/transliterate_widget/doc/RELEASE_NOTES.md b/transliterate_widget/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..58e77cf9f --- /dev/null +++ b/transliterate_widget/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 06.03.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for Transliterate Widget diff --git a/transliterate_widget/models/__init__.py b/transliterate_widget/models/__init__.py new file mode 100644 index 000000000..46b0de369 --- /dev/null +++ b/transliterate_widget/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import res_config_settings diff --git a/transliterate_widget/models/res_config_settings.py b/transliterate_widget/models/res_config_settings.py new file mode 100644 index 000000000..d68a63f28 --- /dev/null +++ b/transliterate_widget/models/res_config_settings.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import api, fields, models + + +class ResConfigSettings(models.TransientModel): + """Config settings for selecting destination language""" + _inherit = 'res.config.settings' + + destination_language = fields.Selection([ + ('am', 'AMHARIC'), ('ar', 'ARABIC'), ('bn', 'BENGALI'), ('zh', 'CHINESE'), + ('en', 'ENGLISH'), ('el', 'GREEK'), ('gu', 'GUJARATI'), ('hi', 'HINDI'), + ('kn', 'KANNADA'), ('ml', 'MALAYALAM'), ('mr', 'MARATHI'), ('ne', 'NEPALI'), + ('or', 'ORIYA'), ('fa', 'PERSIAN'), ('pa', 'PUNJABI'), ('ru', 'RUSSIAN'), + ('sa', 'SANSKRIT'), ('sr', 'SERBIAN'), ('si', 'SINHALESE'), ('ta', 'TAMIL'), + ('te', 'TELUGU'), ('ti', 'TIGRINYA'), ('ur', 'URDU')], + string='Language', default='ml', config_parameter='transliterate_widget.dest_lang') + + @api.model + def get_values(self): + res = super(ResConfigSettings, self).get_values() + res.update( + destination_language=self.env['ir.config_parameter'].sudo().get_param('destination_language') or 'en' + ) + return res + + def set_values(self): + super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param("destination_language", self.destination_language) + + @api.model + def get_config_value(self, config_name): + """Method to get config value for rpc call""" + config_value = self.env['ir.config_parameter'].sudo().get_param(config_name) + return config_value + diff --git a/transliterate_widget/static/description/banner.png b/transliterate_widget/static/description/banner.png new file mode 100644 index 000000000..c3fd98de1 Binary files /dev/null and b/transliterate_widget/static/description/banner.png differ diff --git a/transliterate_widget/static/description/icon.png b/transliterate_widget/static/description/icon.png new file mode 100644 index 000000000..c2b06436f Binary files /dev/null and b/transliterate_widget/static/description/icon.png differ diff --git a/transliterate_widget/static/description/images/auto_fill.jpeg b/transliterate_widget/static/description/images/auto_fill.jpeg new file mode 100644 index 000000000..434e8bfe3 Binary files /dev/null and b/transliterate_widget/static/description/images/auto_fill.jpeg differ diff --git a/transliterate_widget/static/description/images/calculator_in_pos.png b/transliterate_widget/static/description/images/calculator_in_pos.png new file mode 100644 index 000000000..4c192dc10 Binary files /dev/null and b/transliterate_widget/static/description/images/calculator_in_pos.png differ diff --git a/transliterate_widget/static/description/images/checked.png b/transliterate_widget/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/transliterate_widget/static/description/images/checked.png differ diff --git a/transliterate_widget/static/description/images/custom_gantt_view.png b/transliterate_widget/static/description/images/custom_gantt_view.png new file mode 100644 index 000000000..edc204b88 Binary files /dev/null and b/transliterate_widget/static/description/images/custom_gantt_view.png differ diff --git a/transliterate_widget/static/description/images/cybrosys.png b/transliterate_widget/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/transliterate_widget/static/description/images/cybrosys.png differ diff --git a/transliterate_widget/static/description/images/dynamic_partner_fields.png b/transliterate_widget/static/description/images/dynamic_partner_fields.png new file mode 100644 index 000000000..bb21eb8d8 Binary files /dev/null and b/transliterate_widget/static/description/images/dynamic_partner_fields.png differ diff --git a/transliterate_widget/static/description/images/dynamic_product_fields.png b/transliterate_widget/static/description/images/dynamic_product_fields.png new file mode 100644 index 000000000..f7c406cfc Binary files /dev/null and b/transliterate_widget/static/description/images/dynamic_product_fields.png differ diff --git a/transliterate_widget/static/description/images/project_custom_gantt.png b/transliterate_widget/static/description/images/project_custom_gantt.png new file mode 100644 index 000000000..eba731e73 Binary files /dev/null and b/transliterate_widget/static/description/images/project_custom_gantt.png differ diff --git a/transliterate_widget/static/description/images/transliterate_widget-1.png b/transliterate_widget/static/description/images/transliterate_widget-1.png new file mode 100644 index 000000000..bf0a722b5 Binary files /dev/null and b/transliterate_widget/static/description/images/transliterate_widget-1.png differ diff --git a/transliterate_widget/static/description/images/transliterate_widget-2.png b/transliterate_widget/static/description/images/transliterate_widget-2.png new file mode 100644 index 000000000..0f4b639db Binary files /dev/null and b/transliterate_widget/static/description/images/transliterate_widget-2.png differ diff --git a/transliterate_widget/static/description/images/transliterate_widget-3.png b/transliterate_widget/static/description/images/transliterate_widget-3.png new file mode 100644 index 000000000..f33431f38 Binary files /dev/null and b/transliterate_widget/static/description/images/transliterate_widget-3.png differ diff --git a/transliterate_widget/static/description/images/transliterate_widget.gif b/transliterate_widget/static/description/images/transliterate_widget.gif new file mode 100644 index 000000000..0f71d0c2d Binary files /dev/null and b/transliterate_widget/static/description/images/transliterate_widget.gif differ diff --git a/transliterate_widget/static/description/index.html b/transliterate_widget/static/description/index.html new file mode 100644 index 000000000..6d298c34d --- /dev/null +++ b/transliterate_widget/static/description/index.html @@ -0,0 +1,508 @@ +
+ cybrosys-logo
+
+
+
+

Transliterate Widget

+

Transliterate Field Text Using Google + Transliterate API

+
+

Key Highlights

+
    +
  • checkWidget for + transliteration. +
  • +
  • checkUsing + widget="transliterate" for applying widget on a field. +
  • +
  • checkAvailable 23 + language transliteration. +
  • +
+
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module creates a new widget for transliteration. Users can use widget="transliterate" + for applying this widget into a field. Google provides 23 languages in this transliteration + process, so the user can configure the destination language from the configuration settings. +

+
+
+ +

Transliterate Widget

+
+
    +
  • + checkWidget + for transliteration. +
  • +
  • + checkUsing + widget="transliterate" for applying widget on a field. +
  • +
  • + checkAvailable + 23 language transliteration. +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+
+ Odoo Industry
+
+
+

+ + Trading

+

+ Easily procure and sell your products.

+
+
+
+
+
+ Odoo Industry +
+
+
+

+ + Manufacturing

+

+ Plan, track and schedule your operations.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Restaurant

+

+ Run your bar or restaurant methodical.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + POS

+

+ Easy configuring and convivial selling.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + E-commerce & Website

+

+ Mobile friendly, awe-inspiring product pages.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Hotel Management

+

+ An all-inclusive hotel management application.

+
+
+
+
+
+ + Odoo Industry
+
+
+

+ + Education

+

+ A Collaborative platform for educational management.

+
+
+
+
+
+ Odoo Industry
+
+
+

+ + 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/transliterate_widget/static/src/js/transliterate_widget.js b/transliterate_widget/static/src/js/transliterate_widget.js new file mode 100644 index 000000000..396b8480a --- /dev/null +++ b/transliterate_widget/static/src/js/transliterate_widget.js @@ -0,0 +1,49 @@ +odoo.define('transliterate_widget.TransliterateWidget', function(require) { + "use strict"; + var field_registry = require('web.field_registry'); + var fields = require('web.basic_fields'); + var rpc = require('web.rpc'); + + google.load("elements", "1", { + packages: "transliteration" + }); + + var FieldTextTransliterate = fields.FieldChar.extend({ + template: 'FieldTextTransliterate', + widget_class: 'oe_form_field_transliterate', + + events: _.extend({}, fields.FieldChar.prototype.events, { + 'click': '_onSelectField', + }), + + _onSelectField: function(ev) { + rpc.query({ + model: 'res.config.settings', + method: 'get_config_value', + args: ['transliterate_widget.dest_lang'], + }, { + shadow: true, + }) + .then(function (result) { + var options = { + sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH, + destinationLanguage: [result], + shortcutKey: 'ctrl+g', + transliterationEnabled: true + }; + var control = new google.elements.transliteration.TransliterationControl(options); + control.makeTransliteratable($('.input_transliterate')); + }); + }, + + }); + + field_registry.add('transliterate', FieldTextTransliterate); + return { + FieldTextTransliterate: FieldTextTransliterate + }; + + +}); + + diff --git a/transliterate_widget/static/src/xml/transliterate_widget.xml b/transliterate_widget/static/src/xml/transliterate_widget.xml new file mode 100644 index 000000000..e43457169 --- /dev/null +++ b/transliterate_widget/static/src/xml/transliterate_widget.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/transliterate_widget/view/assets.xml b/transliterate_widget/view/assets.xml new file mode 100644 index 000000000..786952e08 --- /dev/null +++ b/transliterate_widget/view/assets.xml @@ -0,0 +1,9 @@ + + +