diff --git a/website_product_publish/README.rst b/website_product_publish/README.rst new file mode 100644 index 000000000..b2ef68bb4 --- /dev/null +++ b/website_product_publish/README.rst @@ -0,0 +1,46 @@ +Quick Product Publish/Unpublish +=============================== + +Quick Product Published & Unpublished on Website, +Multi Product Publish, +Category vise publish + +Depends +======= +[website_sale] addon Odoo + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/14.0/setup/install.html +- Install our custom addon + +License +======= +GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) +(http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + + +Author +------ +* Developer v13:Meera K +* Developer v14:Vinaya S B + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. diff --git a/website_product_publish/__init__.py b/website_product_publish/__init__.py new file mode 100644 index 000000000..ae8c023d2 --- /dev/null +++ b/website_product_publish/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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 +from . import wizard diff --git a/website_product_publish/__manifest__.py b/website_product_publish/__manifest__.py new file mode 100644 index 000000000..4de7954e9 --- /dev/null +++ b/website_product_publish/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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': 'Quick Product Publish/Unpublish', + 'version': '14.0.1.0.0', + 'summary': """Quick Product Publish& Unpublish on Website, Multiple Product Publish, Category wise publish""", + 'description': """quick product published & unpublished on website, multi product publish, category vise publish, + multi product publish/unpublish, products published & unpublished on website, + quick product publishe, publish all products in a category, website publish, all publish, + publish, unpublish, odoo13, website, ecommerce, + """, + 'category': 'Website', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['website_sale'], + 'data': [ + 'views/assets.xml', + 'views/product_template.xml', + 'views/product_category.xml', + 'security/ir.model.access.csv', + 'wizard/product_publish_view.xml', + + ], + 'qweb': ["static/src/xml/website_backend_quick_publish.xml"], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_product_publish/doc/RELEASE_NOTES.md b/website_product_publish/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..42c878a46 --- /dev/null +++ b/website_product_publish/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 17.10.2020 +#### Version 14.0.1.0.0 +##### ADD + +- Initial Commit for website_product_publish + + diff --git a/website_product_publish/models/__init__.py b/website_product_publish/models/__init__.py new file mode 100644 index 000000000..22284f3d6 --- /dev/null +++ b/website_product_publish/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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 product_template +from . import product_category + + diff --git a/website_product_publish/models/product_category.py b/website_product_publish/models/product_category.py new file mode 100644 index 000000000..47d68a73a --- /dev/null +++ b/website_product_publish/models/product_category.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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 models, api, fields, _ + + +class ProductCategory(models.Model): + _inherit = 'product.category' + + published_count = fields.Integer(string="Published", compute='compute_count') + unpublished_count = fields.Integer(string="Unpublished", compute='compute_count') + + def compute_count(self): + for rec in self: + products = self.env['product.template'].search([('categ_id', '=', rec.id)]) + published = products.filtered(lambda product: product.is_published == True and product.sale_ok == True) + unpublished = products.filtered(lambda product: product.is_published == False and product.sale_ok == True) + rec.published_count = len(published) + rec.unpublished_count = len(unpublished) + + def action_publish_all_products(self): + for rec in self: + products = self.env['product.template'].search([('categ_id', '=', rec.id)]) + products = products.filtered(lambda product: product.sale_ok == True) + for product in products: + if not product.is_published: + product.is_published = True + diff --git a/website_product_publish/models/product_template.py b/website_product_publish/models/product_template.py new file mode 100644 index 000000000..0cc7839f6 --- /dev/null +++ b/website_product_publish/models/product_template.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-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 models, api, fields, _ + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + def quick_publish_products(self): + for rec in self: + rec.is_published = True if not rec.is_published else False + + return { + 'type': 'ir.actions.client', + 'tag': 'reload', + } diff --git a/website_product_publish/security/ir.model.access.csv b/website_product_publish/security/ir.model.access.csv new file mode 100644 index 000000000..d5f71ad8b --- /dev/null +++ b/website_product_publish/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_product_publish_wizard,access_product_publish_wizard_name,model_product_publish_wizard,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/website_product_publish/static/description/banner.png b/website_product_publish/static/description/banner.png new file mode 100644 index 000000000..c41b673d3 Binary files /dev/null and b/website_product_publish/static/description/banner.png differ diff --git a/website_product_publish/static/description/icon.png b/website_product_publish/static/description/icon.png new file mode 100644 index 000000000..735135276 Binary files /dev/null and b/website_product_publish/static/description/icon.png differ diff --git a/website_product_publish/static/description/images/checked.png b/website_product_publish/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/website_product_publish/static/description/images/checked.png differ diff --git a/website_product_publish/static/description/images/cybrosys.png b/website_product_publish/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/website_product_publish/static/description/images/cybrosys.png differ diff --git a/website_product_publish/static/description/images/dynamic_product_fields.png b/website_product_publish/static/description/images/dynamic_product_fields.png new file mode 100644 index 000000000..f7c406cfc Binary files /dev/null and b/website_product_publish/static/description/images/dynamic_product_fields.png differ diff --git a/website_product_publish/static/description/images/product_brand_sale.png b/website_product_publish/static/description/images/product_brand_sale.png new file mode 100644 index 000000000..aa12beabb Binary files /dev/null and b/website_product_publish/static/description/images/product_brand_sale.png differ diff --git a/website_product_publish/static/description/images/product_expiry_warning.png b/website_product_publish/static/description/images/product_expiry_warning.png new file mode 100644 index 000000000..9863912e3 Binary files /dev/null and b/website_product_publish/static/description/images/product_expiry_warning.png differ diff --git a/website_product_publish/static/description/images/product_import.png b/website_product_publish/static/description/images/product_import.png new file mode 100644 index 000000000..f3e6acaec Binary files /dev/null and b/website_product_publish/static/description/images/product_import.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish1.png b/website_product_publish/static/description/images/quick_product_publish1.png new file mode 100644 index 000000000..b74959081 Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish1.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish2.png b/website_product_publish/static/description/images/quick_product_publish2.png new file mode 100644 index 000000000..724b9a87e Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish2.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish3.png b/website_product_publish/static/description/images/quick_product_publish3.png new file mode 100644 index 000000000..347150628 Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish3.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish4.png b/website_product_publish/static/description/images/quick_product_publish4.png new file mode 100644 index 000000000..077ad3afe Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish4.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish5.png b/website_product_publish/static/description/images/quick_product_publish5.png new file mode 100644 index 000000000..445cd6e4f Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish5.png differ diff --git a/website_product_publish/static/description/images/quick_product_publish_main.png b/website_product_publish/static/description/images/quick_product_publish_main.png new file mode 100644 index 000000000..aa193a5a0 Binary files /dev/null and b/website_product_publish/static/description/images/quick_product_publish_main.png differ diff --git a/website_product_publish/static/description/images/sale_discount_total.png b/website_product_publish/static/description/images/sale_discount_total.png new file mode 100644 index 000000000..daf1f9f1e Binary files /dev/null and b/website_product_publish/static/description/images/sale_discount_total.png differ diff --git a/website_product_publish/static/description/images/sale_product_image.png b/website_product_publish/static/description/images/sale_product_image.png new file mode 100644 index 000000000..e8ee71737 Binary files /dev/null and b/website_product_publish/static/description/images/sale_product_image.png differ diff --git a/website_product_publish/static/description/index.html b/website_product_publish/static/description/index.html new file mode 100644 index 000000000..207f3b63c --- /dev/null +++ b/website_product_publish/static/description/index.html @@ -0,0 +1,552 @@ +
+ cybrosys-logo
+
+
+
+

Quick Product Publish/Unpublish

+

Publish or unpublish multiple products and publish products without redirecting to website.

+
+

Key Highlights

+
    +
  • + check + Publish/Unpublish multiple products. +
  • +
  • + check + Publish products based on category. +
  • +
  • + check + Quick publish/unpublush button (without redirecting to website.) +
  • + +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ +

Overview

+
+

+ This module helps you to publish/unpublish products without redirecting to the website. It also provides an option to publish/unpublish multiple products from the list view and the products can be published category wise. The count of published and unpublished products in each category is also shown. +

+
+
+ +

Quick Product Publish/Unpublish

+
+
    +
  • + + Multiple product publish/unpublish from list view +
  • +
  • + + Category wise publish/unpublish +
  • +
  • + + Quick product publish/unpublish without redirecting to website +
  • +
  • + + Published/unpublished product count in category +
  • +
+
+ +
+
+

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 +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ diff --git a/website_product_publish/static/src/js/quick_button.js b/website_product_publish/static/src/js/quick_button.js new file mode 100644 index 000000000..8120d28c9 --- /dev/null +++ b/website_product_publish/static/src/js/quick_button.js @@ -0,0 +1,52 @@ +odoo.define('website_product_publish.quick_.button', function (require) { +'use strict'; + +var AbstractField = require('web.AbstractField'); +var core = require('web.core'); +var field_registry = require('web.field_registry'); + +var _t = core._t; + +// Creating a new button widget for 'Quick Publish' which works same as the current publish button widget. + +var QuickWebsitePublishButton = AbstractField.extend({ + template: 'QuickWebsitePublishButton', + events: { + 'click': '_onClick', + }, + + start: function () { + this.$icon = this.$('.o_button_icon'); + return this._super.apply(this, arguments); + }, + + isSet: function () { + return true; + }, + + _render: function () { + this._super.apply(this, arguments); + + var published = this.value; + var info = published ? _t("Published") : _t("Unpublished"); + this.$el.attr('aria-label', info) + .prop('title', info); + this.$icon.toggleClass('text-danger', !published) + .toggleClass('text-success', published); + }, + + _onClick: function () { + var self = this; + this._rpc({ + model: this.model, + method: 'quick_publish_products', + args: [this.res_id], + }).then(function (result) { + self.do_action(result); + }); + }, +}); + +field_registry + .add('quick_publish_button', QuickWebsitePublishButton) +}); diff --git a/website_product_publish/static/src/xml/website_backend_quick_publish.xml b/website_product_publish/static/src/xml/website_backend_quick_publish.xml new file mode 100644 index 000000000..58e4da468 --- /dev/null +++ b/website_product_publish/static/src/xml/website_backend_quick_publish.xml @@ -0,0 +1,20 @@ + + + + + + + + diff --git a/website_product_publish/views/assets.xml b/website_product_publish/views/assets.xml new file mode 100644 index 000000000..05e1e5943 --- /dev/null +++ b/website_product_publish/views/assets.xml @@ -0,0 +1,12 @@ + + +