diff --git a/product_combo_pack/README.rst b/product_combo_pack/README.rst new file mode 100644 index 000000000..464510c83 --- /dev/null +++ b/product_combo_pack/README.rst @@ -0,0 +1,41 @@ +Product Pack +============ +* Create product pack which is a great way to raise average sales price per product, to serve customers with products that make their lives easier, and to leverage current products into new and different ones. + +Installation +============ + - www.odoo.com/documentation/13.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/13.0/legal/licenses/licenses.html) + +Company +------- +* 'Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: +Afras @ Cybrosys, Contact: afras@cybrosys.in + +Contacts +-------- +* Mail Contact : odoo@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 +========== +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ + diff --git a/product_combo_pack/__init__.py b/product_combo_pack/__init__.py new file mode 100644 index 000000000..c4b2a59a5 --- /dev/null +++ b/product_combo_pack/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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 \ No newline at end of file diff --git a/product_combo_pack/__manifest__.py b/product_combo_pack/__manifest__.py new file mode 100644 index 000000000..5a9d95621 --- /dev/null +++ b/product_combo_pack/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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': 'Product Pack', + 'version': '13.0.1.0.0', + 'summary': 'Manage Products as Pack', + 'description': 'Manage Products as Pack', + 'category': 'Sales', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'sale_management', 'stock'], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_form_view.xml', + 'wizard/select_product_pack_view.xml', + 'views/sale_order_view.xml', + ], + 'images': ['static/description/banner.png'], + 'installable': True, + 'license': 'AGPL-3', + 'auto_install': False, +} diff --git a/product_combo_pack/doc/RELEASE_NOTES.md b/product_combo_pack/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..666eef325 --- /dev/null +++ b/product_combo_pack/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module + +#### 02.05.2020 +#### Version 13.0.1.0.0 +Initial Commit for product_combo_pack diff --git a/product_combo_pack/models/__init__.py b/product_combo_pack/models/__init__.py new file mode 100644 index 000000000..3ffdc8c37 --- /dev/null +++ b/product_combo_pack/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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_form +from . import pack_products +from . import sale_order diff --git a/product_combo_pack/models/pack_products.py b/product_combo_pack/models/pack_products.py new file mode 100644 index 000000000..192c0f47d --- /dev/null +++ b/product_combo_pack/models/pack_products.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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, _ +from odoo.exceptions import UserError, ValidationError + + +class PackProducts(models.Model): + _name = 'pack.products' + _rec_name = 'product_tmpl_id' + _description = 'Select Pack Products' + + product_id = fields.Many2one('product.product', string = 'Product', required = True, + domain = [('is_pack', '=', False)]) + product_tmpl_id = fields.Many2one('product.template', string = 'Product') + price = fields.Float('Price', compute = 'compute_price', store = True) + quantity = fields.Integer('Quantity', default = 1) + qty_available = fields.Float('Quantity Available', compute = 'compute_quantity_of_product', store = True, readonly = False) + total_available_quantity = fields.Float('Total Quantity') + + @api.depends('product_id', 'total_available_quantity', 'product_id.qty_available') + def compute_quantity_of_product(self): + for record in self: + location_id = record.product_tmpl_id.pack_location_id + if location_id: + stock_quant = self.env['stock.quant'].search([('product_id','=',record.product_id.id),('location_id','=',location_id.id)]) + if stock_quant: + record.qty_available = stock_quant.quantity + else: + record.qty_available = False + else: + record.qty_available = False + + @api.depends('product_id', 'quantity') + def compute_price(self): + for record in self: + record.price = record.product_id.lst_price * record.quantity + + @api.onchange('quantity') + def set_price(self): + self.price = self.product_id.lst_price * self.quantity + + @api.constrains('quantity') + def _check_positive_qty(self): + if any([ml.quantity < 0 for ml in self]): + raise ValidationError(_('You can not enter negative quantities.')) \ No newline at end of file diff --git a/product_combo_pack/models/product_form.py b/product_combo_pack/models/product_form.py new file mode 100644 index 000000000..0bba24d0c --- /dev/null +++ b/product_combo_pack/models/product_form.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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, _ +from odoo.exceptions import UserError + + +class ProductPack(models.Model): + _inherit = 'product.template' + + def default_pack_location(self): + company_user = self.env.company + warehouse = self.env['stock.warehouse'].search([('company_id', '=', company_user.id)], limit = 1) + if warehouse: + return warehouse.lot_stock_id.id + + is_pack = fields.Boolean('Is a Pack') + pack_price = fields.Integer(string = "Pack Price", compute = 'set_pack_price', store = True) + pack_products_ids = fields.One2many('pack.products', 'product_tmpl_id', string = 'Pack Products') + pack_quantity = fields.Integer('Pack Quantity') + pack_location_id = fields.Many2one('stock.location', + domain = [('usage', 'in', ['internal', 'transit'])], + default = default_pack_location) + + @api.depends('pack_products_ids', 'pack_products_ids.price') + def set_pack_price(self): + price = 0 + for record in self: + for line in record.pack_products_ids: + price = price + line.price + record.pack_price = price + + @api.model + def create(self, values): + if values.get('is_pack', False): + if not values.get('pack_products_ids', []): + raise UserError(_( + 'You need to add atleast one product in the Pack...!')) + if values.get('type', False) == 'service': + raise UserError(_('You cannot define a pack product as a service..!')) + return super(ProductPack, self).create(values) + + def write(self, values): + super(ProductPack, self).write(values) + if self.is_pack: + if not self.pack_products_ids: + raise UserError(_( + 'You need to add atleast one product in the Pack...!')) + if self.type == 'service': + raise UserError(_('You cannot define a pack product as a service..!')) + + def update_price_product(self): + self.lst_price = self.pack_price + + def get_quantity(self): + total_quantity = 1 + flag = 1 + while flag: + for line in self.pack_products_ids: + if line.qty_available >= line.quantity * total_quantity: + continue + else: + if line.product_id.type != 'product': + continue + flag = 0 + break + if flag: + total_quantity = total_quantity + 1 + self.pack_quantity = total_quantity - 1 + + def update_quantity(self): + company_user = self.env.company + product_id = len(self.product_variant_ids) == 1 and self.product_variant_id.id + location_id = self.pack_location_id.id + if not location_id: + warehouse = self.env['stock.warehouse'].search([('company_id', '=', company_user.id)], limit = 1) + location_id = warehouse.lot_stock_id.id + if not location_id: + raise UserError(_( + 'You need to select the location to update the pack quantity...!')) + self.env['stock.quant'].with_context(inventory_mode = True).sudo().create({ + 'product_id': product_id, + 'location_id': location_id, + 'inventory_quantity': self.pack_quantity, + }) + + @api.onchange('pack_location_id') + def change_quantity_based_on_location(self): + for line in self.pack_products_ids: + stock_quant = self.env['stock.quant'].search( + [('product_id', '=', line.product_id.id), ('location_id', '=', self.pack_location_id.id)]) + if stock_quant: + line.total_available_quantity = stock_quant.quantity + + else: + line.total_available_quantity = stock_quant.quantity \ No newline at end of file diff --git a/product_combo_pack/models/sale_order.py b/product_combo_pack/models/sale_order.py new file mode 100644 index 000000000..7afe00ec4 --- /dev/null +++ b/product_combo_pack/models/sale_order.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Afras Habis (odoo@cybrosys.com) +# +# 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 SalePack(models.Model): + _inherit = 'sale.order' + + def action_confirm(self): + super(SalePack, self).action_confirm() + for line in self.order_line: + if line.product_id.is_pack: + for record in line.product_id.pack_products_ids: + dest_loc = self.env.ref('stock.stock_location_customers').id + self.env['stock.move'].create({ + 'name': record.product_id.name, + 'product_id': record.product_id.id, + 'product_uom_qty': record.quantity * line.product_uom_qty, + 'product_uom': record.product_id.uom_id.id, + 'picking_id': self.picking_ids[0].id, + 'location_id': self.picking_ids.picking_type_id.default_location_src_id.id, + 'location_dest_id': dest_loc, + }) diff --git a/product_combo_pack/security/ir.model.access.csv b/product_combo_pack/security/ir.model.access.csv new file mode 100644 index 000000000..b737db5c9 --- /dev/null +++ b/product_combo_pack/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_pack_products,access.pack.products,model_pack_products,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/product_combo_pack/static/description/banner.png b/product_combo_pack/static/description/banner.png new file mode 100644 index 000000000..5789ecb03 Binary files /dev/null and b/product_combo_pack/static/description/banner.png differ diff --git a/product_combo_pack/static/description/icon.png b/product_combo_pack/static/description/icon.png new file mode 100644 index 000000000..5fbd7b66f Binary files /dev/null and b/product_combo_pack/static/description/icon.png differ diff --git a/product_combo_pack/static/description/images/banner_barcode_scanning.jpeg b/product_combo_pack/static/description/images/banner_barcode_scanning.jpeg new file mode 100644 index 000000000..529143e4e Binary files /dev/null and b/product_combo_pack/static/description/images/banner_barcode_scanning.jpeg differ diff --git a/product_combo_pack/static/description/images/banner_currency_total.png b/product_combo_pack/static/description/images/banner_currency_total.png new file mode 100644 index 000000000..6153ed719 Binary files /dev/null and b/product_combo_pack/static/description/images/banner_currency_total.png differ diff --git a/product_combo_pack/static/description/images/banner_customer_sequence.jpeg b/product_combo_pack/static/description/images/banner_customer_sequence.jpeg new file mode 100644 index 000000000..7451342d6 Binary files /dev/null and b/product_combo_pack/static/description/images/banner_customer_sequence.jpeg differ diff --git a/product_combo_pack/static/description/images/banner_previous_rates.jpeg b/product_combo_pack/static/description/images/banner_previous_rates.jpeg new file mode 100644 index 000000000..e10c28799 Binary files /dev/null and b/product_combo_pack/static/description/images/banner_previous_rates.jpeg differ diff --git a/product_combo_pack/static/description/images/banner_product_branding.png b/product_combo_pack/static/description/images/banner_product_branding.png new file mode 100644 index 000000000..aa12beabb Binary files /dev/null and b/product_combo_pack/static/description/images/banner_product_branding.png differ diff --git a/product_combo_pack/static/description/images/banner_product_expiry.jpeg b/product_combo_pack/static/description/images/banner_product_expiry.jpeg new file mode 100644 index 000000000..84a872d44 Binary files /dev/null and b/product_combo_pack/static/description/images/banner_product_expiry.jpeg differ diff --git a/product_combo_pack/static/description/images/checked.png b/product_combo_pack/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/product_combo_pack/static/description/images/checked.png differ diff --git a/product_combo_pack/static/description/images/cybrosys.png b/product_combo_pack/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/product_combo_pack/static/description/images/cybrosys.png differ diff --git a/product_combo_pack/static/description/images/pack1.png b/product_combo_pack/static/description/images/pack1.png new file mode 100644 index 000000000..81536d5ab Binary files /dev/null and b/product_combo_pack/static/description/images/pack1.png differ diff --git a/product_combo_pack/static/description/images/pack10.png b/product_combo_pack/static/description/images/pack10.png new file mode 100644 index 000000000..09c07f10e Binary files /dev/null and b/product_combo_pack/static/description/images/pack10.png differ diff --git a/product_combo_pack/static/description/images/pack11.png b/product_combo_pack/static/description/images/pack11.png new file mode 100644 index 000000000..fc5ea8c88 Binary files /dev/null and b/product_combo_pack/static/description/images/pack11.png differ diff --git a/product_combo_pack/static/description/images/pack12.png b/product_combo_pack/static/description/images/pack12.png new file mode 100644 index 000000000..d125f945d Binary files /dev/null and b/product_combo_pack/static/description/images/pack12.png differ diff --git a/product_combo_pack/static/description/images/pack13.png b/product_combo_pack/static/description/images/pack13.png new file mode 100644 index 000000000..3fd7e3783 Binary files /dev/null and b/product_combo_pack/static/description/images/pack13.png differ diff --git a/product_combo_pack/static/description/images/pack14.png b/product_combo_pack/static/description/images/pack14.png new file mode 100644 index 000000000..89a5cc2b4 Binary files /dev/null and b/product_combo_pack/static/description/images/pack14.png differ diff --git a/product_combo_pack/static/description/images/pack2.png b/product_combo_pack/static/description/images/pack2.png new file mode 100644 index 000000000..0407fb11d Binary files /dev/null and b/product_combo_pack/static/description/images/pack2.png differ diff --git a/product_combo_pack/static/description/images/pack3.png b/product_combo_pack/static/description/images/pack3.png new file mode 100644 index 000000000..bd162158a Binary files /dev/null and b/product_combo_pack/static/description/images/pack3.png differ diff --git a/product_combo_pack/static/description/images/pack4.png b/product_combo_pack/static/description/images/pack4.png new file mode 100644 index 000000000..440aa4186 Binary files /dev/null and b/product_combo_pack/static/description/images/pack4.png differ diff --git a/product_combo_pack/static/description/images/pack5.png b/product_combo_pack/static/description/images/pack5.png new file mode 100644 index 000000000..0cf72eae2 Binary files /dev/null and b/product_combo_pack/static/description/images/pack5.png differ diff --git a/product_combo_pack/static/description/images/pack6.png b/product_combo_pack/static/description/images/pack6.png new file mode 100644 index 000000000..a1b2661ef Binary files /dev/null and b/product_combo_pack/static/description/images/pack6.png differ diff --git a/product_combo_pack/static/description/images/pack7.png b/product_combo_pack/static/description/images/pack7.png new file mode 100644 index 000000000..92c1bebf7 Binary files /dev/null and b/product_combo_pack/static/description/images/pack7.png differ diff --git a/product_combo_pack/static/description/images/pack8.png b/product_combo_pack/static/description/images/pack8.png new file mode 100644 index 000000000..cf636bb58 Binary files /dev/null and b/product_combo_pack/static/description/images/pack8.png differ diff --git a/product_combo_pack/static/description/images/pack9.png b/product_combo_pack/static/description/images/pack9.png new file mode 100644 index 000000000..754b572b7 Binary files /dev/null and b/product_combo_pack/static/description/images/pack9.png differ diff --git a/product_combo_pack/static/description/images/pack_main.png b/product_combo_pack/static/description/images/pack_main.png new file mode 100644 index 000000000..8b2b5b854 Binary files /dev/null and b/product_combo_pack/static/description/images/pack_main.png differ diff --git a/product_combo_pack/static/description/index.html b/product_combo_pack/static/description/index.html new file mode 100644 index 000000000..c5ae9bff3 --- /dev/null +++ b/product_combo_pack/static/description/index.html @@ -0,0 +1,432 @@ +
cybrosys-logo
+
+
+
+

Product Pack

+
+

Key Highlights

+
    +
  • checkSell Product as Pack Easily
  • +
+
    +
  • checkManage the stock of Pack as well as Individual Product
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ Selling products in a pack is a great way to raise average sales price per product, to serve customers with products that make their lives easier, and to leverage current products into new and different ones. They are profitable for smaller businesses as well as large ones. +

+
+
+ +

Product Pack

+
+
    +
  • + checkCreate a Product Pack Easily. +
  • +
+
    +
  • + checkManage the stock of the Product. +
  • +
+
    +
  • + checkCompute the Price of the Pack. +
  • +
+
    +
  • + checkCompute the Quantity of the Pack with respect to the quantity of Pack items. +
  • +
+
    +
  • + checkUpdate the quantity of pack easily . +
  • +
+
    +
  • + checkAdding Pack into Sale order Easily. +
  • +
+
    +
  • + checkFilter Pack from Products. +
  • +
+
+ +
+
+

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/product_combo_pack/views/product_form_view.xml b/product_combo_pack/views/product_form_view.xml new file mode 100644 index 000000000..aab0211ad --- /dev/null +++ b/product_combo_pack/views/product_form_view.xml @@ -0,0 +1,105 @@ + + + + + product.product.inherit.pack + product.product + + + +
+ +
+
+
+
+ + + product.template.inherit.pack + product.template + + + +
+ +
+
+ + {'invisible': [('is_pack','=',True)]} + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + Product Pack + ir.actions.act_window + product.template + kanban,form + [('is_pack','=',True)] + {'default_is_pack' : True} + +

+ There is no product pack to show...! +

+
+
+ + + product.template.search.inherit + product.template + + + + + + + + + + +
+
\ No newline at end of file diff --git a/product_combo_pack/views/sale_order_view.xml b/product_combo_pack/views/sale_order_view.xml new file mode 100644 index 000000000..2d6ffa4ba --- /dev/null +++ b/product_combo_pack/views/sale_order_view.xml @@ -0,0 +1,15 @@ + + + + + Product Pack in sale order + sale.order + + + +