diff --git a/create_not_exist/README.rst b/create_not_exist/README.rst new file mode 100644 index 000000000..ea665b9f0 --- /dev/null +++ b/create_not_exist/README.rst @@ -0,0 +1,49 @@ +Create Related Records While Importing +====================================== + +This module comes under Odoo Extra Tools Marketing. +It will allow the users to enable the create if not exist option while importing, even if not in developer mode + +Usage +===== + +After installation, go to any import function and select an XLSX or CSV file. + +Configuration +============= + +No additional configurations required + + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: + Muhammed Nishad TK + +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/create_not_exist/__init__.py b/create_not_exist/__init__.py new file mode 100644 index 000000000..67ca7ce6c --- /dev/null +++ b/create_not_exist/__init__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Nishad () +# +# 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 . +# +################################################################################### diff --git a/create_not_exist/__manifest__.py b/create_not_exist/__manifest__.py new file mode 100644 index 000000000..1b3efc2b3 --- /dev/null +++ b/create_not_exist/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Nishad () +# +# 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': "Create Related Records While Importing", + 'version': '13.0.1.0.0', + 'summary': 'Import related records even if they are not exist without developer mode', + "description": """Import related records even if they are not exist without developer mode""", + 'category': 'Extra Tools', + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['base'], + 'data': [ + 'views/assets.xml', + ], + 'images': ['static/description/banner.png'], + 'license': "AGPL-3", + 'installable': True, + 'application': False, +} diff --git a/create_not_exist/doc/RELEASE_NOTES.md b/create_not_exist/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f6e6fc644 --- /dev/null +++ b/create_not_exist/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 30.01.2020 +#### Version 13.0.1.0.0 +##### ADD +- Initial commit for create_not_exist. + diff --git a/create_not_exist/static/description/banner.png b/create_not_exist/static/description/banner.png new file mode 100644 index 000000000..b19e5fdb1 Binary files /dev/null and b/create_not_exist/static/description/banner.png differ diff --git a/create_not_exist/static/description/icon.png b/create_not_exist/static/description/icon.png new file mode 100644 index 000000000..dcdc459b3 Binary files /dev/null and b/create_not_exist/static/description/icon.png differ diff --git a/create_not_exist/static/description/images/banner_lifeline_for_task.jpeg b/create_not_exist/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/create_not_exist/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/create_not_exist/static/description/images/banner_project_report_xls_pdf.png b/create_not_exist/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/create_not_exist/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/create_not_exist/static/description/images/banner_project_status_report.png b/create_not_exist/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/create_not_exist/static/description/images/banner_project_status_report.png differ diff --git a/create_not_exist/static/description/images/banner_subtask.jpeg b/create_not_exist/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/create_not_exist/static/description/images/banner_subtask.jpeg differ diff --git a/create_not_exist/static/description/images/banner_task_deadline_reminder.jpeg b/create_not_exist/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/create_not_exist/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/create_not_exist/static/description/images/banner_task_statusbar.jpeg b/create_not_exist/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/create_not_exist/static/description/images/banner_task_statusbar.jpeg differ diff --git a/create_not_exist/static/description/images/checked.png b/create_not_exist/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/create_not_exist/static/description/images/checked.png differ diff --git a/create_not_exist/static/description/images/create_1.png b/create_not_exist/static/description/images/create_1.png new file mode 100644 index 000000000..d61dfe702 Binary files /dev/null and b/create_not_exist/static/description/images/create_1.png differ diff --git a/create_not_exist/static/description/images/create_2.png b/create_not_exist/static/description/images/create_2.png new file mode 100644 index 000000000..2472b52ac Binary files /dev/null and b/create_not_exist/static/description/images/create_2.png differ diff --git a/create_not_exist/static/description/images/create_3.png b/create_not_exist/static/description/images/create_3.png new file mode 100644 index 000000000..6b274d1cf Binary files /dev/null and b/create_not_exist/static/description/images/create_3.png differ diff --git a/create_not_exist/static/description/images/create_4.png b/create_not_exist/static/description/images/create_4.png new file mode 100644 index 000000000..baff47716 Binary files /dev/null and b/create_not_exist/static/description/images/create_4.png differ diff --git a/create_not_exist/static/description/images/cybrosys.png b/create_not_exist/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/create_not_exist/static/description/images/cybrosys.png differ diff --git a/create_not_exist/static/description/index.html b/create_not_exist/static/description/index.html new file mode 100644 index 000000000..cac781f74 --- /dev/null +++ b/create_not_exist/static/description/index.html @@ -0,0 +1,311 @@ +
cybrosys-logo
+
+
+
+

Create Related Records While Importing

+

Import related records even if they are not exist.

+
+

Key Highlights

+
    +
  • checkEasily import records in odoo without any overburden.
  • +
  • check Import related records even if they are not exist without developer mode
  • +
  • check Apart from Existing import features, It allows to create One2many records while importing
  • +
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This app allows you to import relative records even if they are not exist without enabling developer mode in odoo.Enable the check box under the related fields to create.It will create new records instead of failing to import.It creates one2many records also. +

+
+
+ +

Create Related Records While Importing

+
+
    +
  • + checkImport fields. +
  • +
  • + checkEasily import related records in odoo without any overburden. +
  • +
  • + checkImport fields even if they are not exist without developer mode. +
  • +
+
+ +
+
+

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/create_not_exist/static/src/js/import_action.js b/create_not_exist/static/src/js/import_action.js new file mode 100644 index 000000000..7ae13f3da --- /dev/null +++ b/create_not_exist/static/src/js/import_action.js @@ -0,0 +1,110 @@ +odoo.define('create_not_exist.import', function (require) { +"use strict"; +var config = require('web.config'); +var core = require('web.core'); +var session = require('web.session'); +var time = require('web.time'); +var AbstractWebClient = require('web.AbstractWebClient'); +var Loading = require('web.Loading'); +var QWeb = core.qweb; +var _t = core._t; +var _lt = core._lt; +var StateMachine = window.StateMachine; +console.log('testtteeee'); +var ImportAction = require('base_import.import').DataImport; +console.log("option2"); +ImportAction.include({ +onpreview_success: function (event, from, to, result) { + var self = this; + this.$buttons.filter('.oe_import_file') + .text(_t('Load New File')) + .removeClass('btn-primary').addClass('btn-secondary') + .blur(); + this.$buttons.filter('.o_import_import, .o_import_validate, .o_import_file_reload').removeClass('d-none'); + this.$form.find('.oe_import_box, .oe_import_with_file').removeClass('d-none'); + this.$form.find('.o_view_nocontent').addClass('d-none'); + this.$form.addClass('oe_import_preview'); + this.$('input.oe_import_advanced_mode').prop('checked', result.advanced_mode); + this.$('.oe_import_grid').html(QWeb.render('ImportView.preview', result)); + + this.$('.o_import_batch_alert').toggleClass('d-none', !result.batch); + + var messages = []; + if (result.headers.length === 1) { + messages.push({type: 'warning', message: _t("A single column was found in the file, this often means the file separator is incorrect")}); + } + + if (!_.isEmpty(messages)) { + this.$('.oe_import_options').show(); + this.onresults(null, null, null, {'messages': messages}); + } + + // merge option values back in case they were updated/guessed + _.each(['encoding', 'separator', 'float_thousand_separator', 'float_decimal_separator'], function (id) { + self.$('.oe_import_' + id).select2('val', result.options[id]) + }); + this.$('.oe_import_date_format').select2('val', time.strftime_to_moment_format(result.options.date_format)); + this.$('.oe_import_datetime_format').val(time.strftime_to_moment_format(result.options.datetime_format)); + // hide all "true debug" options when not in debug mode + this.$('.oe_import_debug_option').toggleClass('d-none', !result.debug); + + var $fields = this.$('.oe_import_fields input'); + this.render_fields_matches(result, $fields); + var data = this.generate_fields_completion(result); + var item_finder = function (id, items) { + items = items || data; + for (var i=0; i < items.length; ++i) { + var item = items[i]; + if (item.id === id) { + return item; + } + var val; + if (item.children && (val = item_finder(id, item.children))) { + return val; + } + } + return ''; + }; + $fields.each(function (k,v) { + var filtered_data = self.generate_fields_completion(result, k); + + var $thing = $(); + var bind = function (d) {}; + bind = function (data) { + $thing = $(QWeb.render('ImportView.create_record_option')).insertAfter(v).hide(); + switch (data.type) { + case 'many2one': case 'many2many': case 'one2many': + $thing.find('input').attr('field', data.id); + $thing.show(); + break; + default: + $thing.find('input').attr('field', '').prop('checked', false); + $thing.hide(); + } + } + + $(v).select2({ + allowClear: true, + minimumInputLength: 0, + data: filtered_data, + initSelection: function (element, callback) { + var default_value = element.val(); + if (!default_value) { + callback(''); + return; + } + + var data = item_finder(default_value); + bind(data); + callback(data); + }, + placeholder: _t('Don\'t import'), + width: 'resolve', + dropdownCssClass: 'oe_import_selector' + }).on('change', function (e) { + bind(item_finder(e.currentTarget.value)); + }); + }); + }, +}); +}) diff --git a/create_not_exist/views/assets.xml b/create_not_exist/views/assets.xml new file mode 100644 index 000000000..bd1e02e19 --- /dev/null +++ b/create_not_exist/views/assets.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file