diff --git a/multi_pricelist/README.rst b/multi_pricelist/README.rst new file mode 100644 index 000000000..a53fbf824 --- /dev/null +++ b/multi_pricelist/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Sale Order Multiple Pricelist +============================= +* Multiple pricelists can be applied to the same sale order + +Configuration +============= +- Need to turn on the option "Multiple Pricelist per Order" from the Sale Order configuration + +Company +======= +* `Cybrosys Techno Solutions `__ + +License +======= +General Public License, version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer : (V17) Bhagyadev KP +* Contact: odoo@cybrosys.com + +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: ``__ \ No newline at end of file diff --git a/multi_pricelist/__init__.py b/multi_pricelist/__init__.py new file mode 100644 index 000000000..a14fc8dea --- /dev/null +++ b/multi_pricelist/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 diff --git a/multi_pricelist/__manifest__.py b/multi_pricelist/__manifest__.py new file mode 100644 index 000000000..62cdde330 --- /dev/null +++ b/multi_pricelist/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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': "Sale Order Multiple Pricelist", + 'version': '17.0.1.0.0', + 'category': 'Sales', + 'summary': 'Multiple price lists can be applied to the same sale order', + 'description': """User can apply different price lists for ech order lines + of the same Sale Order.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['sale_management'], + 'data': [ + 'security/ir.model.access.csv', + 'views/sale_order_views.xml', + 'views/res_config_settings_views.xml', + 'wizard/pricelist_product_views.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/multi_pricelist/doc/RELEASE_NOTES.md b/multi_pricelist/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..94146f344 --- /dev/null +++ b/multi_pricelist/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +### 04.07.2024 +### Version 17.0.1.0.0 +#### ADD +- Initial Commit for Sale Order Multiple Pricelist diff --git a/multi_pricelist/models/__init__.py b/multi_pricelist/models/__init__.py new file mode 100644 index 000000000..f8488cf55 --- /dev/null +++ b/multi_pricelist/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 res_config_settings +from . import sale_order_line diff --git a/multi_pricelist/models/res_config_settings.py b/multi_pricelist/models/res_config_settings.py new file mode 100644 index 000000000..d9d4a8b7e --- /dev/null +++ b/multi_pricelist/models/res_config_settings.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 ResConfigSettings(models.TransientModel): + """This class inherits res config settings model to add the settings + for multiple price lists""" + _inherit = 'res.config.settings' + + multi_pricelist = fields.Boolean(string="Multiple Pricelists", + help="Multiple price lists" + "for the same sale order") + + @api.model + def get_values(self): + """Supering the get_values method to get multi_price list field.""" + res = super(ResConfigSettings, self).get_values() + multi_pricelist = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'multi_pricelist.multi_pricelist') + res.update( + multi_pricelist=multi_pricelist, + ) + return res + + def set_values(self): + """Supering the set_values method to set multi_price list field.""" + super(ResConfigSettings, self).set_values() + param = self.env['ir.config_parameter'].sudo() + param.set_param('multi_pricelist.multi_pricelist', + self.multi_pricelist) diff --git a/multi_pricelist/models/sale_order_line.py b/multi_pricelist/models/sale_order_line.py new file mode 100644 index 000000000..aad9cef5e --- /dev/null +++ b/multi_pricelist/models/sale_order_line.py @@ -0,0 +1,185 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 datetime import datetime +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class SaleOrderLine(models.Model): + """Inherits Sale order line to add the functions for checking the + visibility of the pricelists in order lines and also apply the + pricelist to order lines""" + _inherit = 'sale.order.line' + + pricelist_visibility = fields.Boolean( + compute="_compute_pricelist_visibility", string="Pricelist Visible", + help="Multi Pricelist enabled or not") + applied_pricelist_id = fields.Many2one('product.pricelist', + string="PriceList", + help="Price lists that is applied to" + "the order line.") + + def _get_pricelist_price(self): + # Overriding the _get_pricelist_price method to apply multiple pricelist + self.ensure_one() + self.product_id.ensure_one() + if self.applied_pricelist_id: + for line in self: + line.pricelist_item_id = line.applied_pricelist_id._get_product_rule( + line.product_id, + quantity=line.product_uom_qty or 1.0, + uom=line.product_uom, + date=line.order_id.date_order, + ) + price = self.pricelist_item_id._compute_price( + product=self.product_id.with_context( + **self._get_product_price_context()), + quantity=self.product_uom_qty or 1.0, + uom=self.product_uom, + date=self.order_id.date_order, + currency=self.currency_id, + ) + return price + else: + price = self.pricelist_item_id._compute_price( + product=self.product_id.with_context( + **self._get_product_price_context()), + quantity=self.product_uom_qty or 1.0, + uom=self.product_uom, + date=self.order_id.date_order, + currency=self.currency_id, + ) + return price + + def apply_pricelist(self): + """This function will help to select all the pricelists + for a product in order line and apply it""" + for rec in self: + date_time_today = datetime.today().strftime("%Y-%m-%d %H:%M:%S") + # find the matching price list for a product + price_ids = self.env['product.pricelist.item'].search( + ['|', '|', ('product_tmpl_id', '=', False), + ('categ_id', '=', rec.product_id.categ_id.id), + ('product_tmpl_id', '=', rec.product_id.product_tmpl_id.id), + ('min_quantity', '<=', rec.product_uom_qty),'|', + ('date_start', '<=', date_time_today), + ('date_start', '=', False), '|', + ('date_end', '>=', date_time_today), + ('date_end', '=', False), + ]) + variant_ids = self.env['product.pricelist.item'].search( + [ + ('product_id', '=', rec.product_id.id), + ('min_quantity', '<=', rec.product_uom_qty), + '|', ('date_start', '<=', date_time_today), + ('date_start', '=', False), '|', + ('date_end', '>=', date_time_today), + ('date_end', '=', False), + ]) + combined_ids = price_ids + variant_ids + if combined_ids: + pricelist_wizard = self.env['pricelist.product'].create({ + 'order_line_id': rec.id, + 'line_ids': [(0, 0, { + 'pricelist_id': price.pricelist_id.id, + 'product_id': rec.product_id.id, + 'unit_price': self.unit_price(price), + 'unit_cost': rec.product_id.standard_price, + 'uom_id': rec.product_id.uom_id.id + }) for price in combined_ids], + }) + else: + raise UserError(_( + "No price list is configured for this product!")) + return { + 'type': 'ir.actions.act_window', + 'target': 'new', + 'name': 'Select Pricelist', + 'view_mode': 'form', + 'view_id': self.env.ref( + "multi_pricelist.pricelist_wizard_view_form", False).id, + 'res_model': 'pricelist.product', + 'res_id': pricelist_wizard.id, + } + + def _compute_pricelist_visibility(self): + """ Computes pricelist_visibility by checking the config parameter.""" + for rec in self: + rec.pricelist_visibility = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'multi_pricelist.multi_pricelist') + if rec.order_id.state in ['sale', 'done', 'cancel']: + rec.pricelist_visibility = False + + def unit_price(self, price): + """Compute the unit price of the product according to the + price_list_item""" + if price.compute_price == 'fixed': + unt_price = price.fixed_price + elif price.compute_price == 'percentage' and price.percent_price != 0: + unt_price = self.product_id.list_price * ( + 1 - price.percent_price / 100) + elif price.compute_price == 'formula' and price.base == 'list_price': + unt_price = (self.product_id.list_price * ( + 1 - price.price_discount / 100) + price.price_surcharge) + if price.price_min_margin or price.price_max_margin: + if (unt_price < price.price_min_margin + + self.product_id.list_price): + unt_price = (price.price_min_margin + + self.product_id.list_price) + elif (unt_price > price.price_max_margin + + self.product_id.list_price): + unt_price = (price.price_max_margin + + self.product_id.list_price) + else: + unt_price = unt_price + elif price.compute_price == 'formula' and price.base == 'standard_price': + unt_price = (self.product_id.standard_price * ( + 1 - price.price_discount / 100) + price.price_surcharge) + if price.price_min_margin or price.price_max_margin: + if (unt_price < price.price_min_margin + + self.product_id.list_price): + unt_price = (price.price_min_margin + + self.product_id.list_price) + elif (unt_price > price.price_max_margin + + self.product_id.list_price): + unt_price = (price.price_max_margin + + self.product_id.list_price) + else: + unt_price = unt_price + elif price.compute_price == 'formula' and price.base == 'pricelist': + unt_price = (self.unit_price(price.base_pricelist_id.item_ids) * ( + 1 - price.price_discount / 100) + price.price_surcharge) + if price.price_min_margin or price.price_max_margin: + if (unt_price < price.price_min_margin + + self.product_id.list_price): + unt_price = (price.price_min_margin + + self.product_id.list_price) + elif (unt_price > price.price_max_margin + + self.product_id.list_price): + unt_price = (price.price_max_margin + + self.product_id.list_price) + else: + unt_price = unt_price + else: + unt_price = self.product_id.list_price + return unt_price diff --git a/multi_pricelist/security/ir.model.access.csv b/multi_pricelist/security/ir.model.access.csv new file mode 100644 index 000000000..ef20ab934 --- /dev/null +++ b/multi_pricelist/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_pricelist_product_user,access.pricelist.product.user,model_pricelist_product,base.group_user,1,1,1,1 +access_pricelist_line_user,access.pricelist.line.user,model_pricelist_line,base.group_user,1,1,1,1 diff --git a/multi_pricelist/static/description/assets/icons/capture (1).png b/multi_pricelist/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/capture (1).png differ diff --git a/multi_pricelist/static/description/assets/icons/check.png b/multi_pricelist/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/check.png differ diff --git a/multi_pricelist/static/description/assets/icons/chevron.png b/multi_pricelist/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/chevron.png differ diff --git a/multi_pricelist/static/description/assets/icons/cogs.png b/multi_pricelist/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/cogs.png differ diff --git a/multi_pricelist/static/description/assets/icons/consultation.png b/multi_pricelist/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/consultation.png differ diff --git a/multi_pricelist/static/description/assets/icons/ecom-black.png b/multi_pricelist/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/ecom-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/education-black.png b/multi_pricelist/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/education-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/hotel-black.png b/multi_pricelist/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/hotel-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/img.png b/multi_pricelist/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/img.png differ diff --git a/multi_pricelist/static/description/assets/icons/license.png b/multi_pricelist/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/license.png differ diff --git a/multi_pricelist/static/description/assets/icons/lifebuoy.png b/multi_pricelist/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/lifebuoy.png differ diff --git a/multi_pricelist/static/description/assets/icons/manufacturing-black.png b/multi_pricelist/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/manufacturing-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/photo-capture.png b/multi_pricelist/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/photo-capture.png differ diff --git a/multi_pricelist/static/description/assets/icons/pos-black.png b/multi_pricelist/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/pos-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/puzzle.png b/multi_pricelist/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/puzzle.png differ diff --git a/multi_pricelist/static/description/assets/icons/restaurant-black.png b/multi_pricelist/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/restaurant-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/service-black.png b/multi_pricelist/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/service-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/trading-black.png b/multi_pricelist/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/trading-black.png differ diff --git a/multi_pricelist/static/description/assets/icons/training.png b/multi_pricelist/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/training.png differ diff --git a/multi_pricelist/static/description/assets/icons/update.png b/multi_pricelist/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/update.png differ diff --git a/multi_pricelist/static/description/assets/icons/user.png b/multi_pricelist/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/user.png differ diff --git a/multi_pricelist/static/description/assets/icons/wrench.png b/multi_pricelist/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/multi_pricelist/static/description/assets/icons/wrench.png differ diff --git a/multi_pricelist/static/description/assets/misc/Cybrosys R.png b/multi_pricelist/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/multi_pricelist/static/description/assets/misc/Cybrosys R.png differ diff --git a/multi_pricelist/static/description/assets/misc/email.svg b/multi_pricelist/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/phone.svg b/multi_pricelist/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/multi_pricelist/static/description/assets/misc/star (1) 2.svg b/multi_pricelist/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/support (1) 1.svg b/multi_pricelist/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/support-email.svg b/multi_pricelist/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/tick-mark.svg b/multi_pricelist/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/whatsapp 1.svg b/multi_pricelist/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/misc/whatsapp.svg b/multi_pricelist/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/multi_pricelist/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/multi_pricelist/static/description/assets/modules/1.jpg b/multi_pricelist/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..08bbafeb6 Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/1.jpg differ diff --git a/multi_pricelist/static/description/assets/modules/2.png b/multi_pricelist/static/description/assets/modules/2.png new file mode 100644 index 000000000..66730082c Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/2.png differ diff --git a/multi_pricelist/static/description/assets/modules/3.jpg b/multi_pricelist/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..3d171226b Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/3.jpg differ diff --git a/multi_pricelist/static/description/assets/modules/4.jpg b/multi_pricelist/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..1f3f2e27f Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/4.jpg differ diff --git a/multi_pricelist/static/description/assets/modules/5.jpg b/multi_pricelist/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..0db717519 Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/5.jpg differ diff --git a/multi_pricelist/static/description/assets/modules/6.jpg b/multi_pricelist/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..cd62a577c Binary files /dev/null and b/multi_pricelist/static/description/assets/modules/6.jpg differ diff --git a/multi_pricelist/static/description/assets/screenshots/1.png b/multi_pricelist/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..5dae53339 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/1.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/2.png b/multi_pricelist/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..49c8959e1 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/2.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/3.png b/multi_pricelist/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..3bebad1e1 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/3.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/4.png b/multi_pricelist/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..bd2ffa9d3 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/4.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/5.png b/multi_pricelist/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..c7c57f44b Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/5.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/6.png b/multi_pricelist/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..079ede2c0 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/6.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/7.png b/multi_pricelist/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..983971cb6 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/7.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/8.png b/multi_pricelist/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..b29836ef0 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/8.png differ diff --git a/multi_pricelist/static/description/assets/screenshots/hero.gif b/multi_pricelist/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..bb04dacb7 Binary files /dev/null and b/multi_pricelist/static/description/assets/screenshots/hero.gif differ diff --git a/multi_pricelist/static/description/banner.jpg b/multi_pricelist/static/description/banner.jpg new file mode 100644 index 000000000..0107907f6 Binary files /dev/null and b/multi_pricelist/static/description/banner.jpg differ diff --git a/multi_pricelist/static/description/icon.png b/multi_pricelist/static/description/icon.png new file mode 100644 index 000000000..321531afc Binary files /dev/null and b/multi_pricelist/static/description/icon.png differ diff --git a/multi_pricelist/static/description/index.html b/multi_pricelist/static/description/index.html new file mode 100644 index 000000000..6d6648fc7 --- /dev/null +++ b/multi_pricelist/static/description/index.html @@ -0,0 +1,653 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

Sale Order Multiple Price list

+

+ Multiple Price Lists Can Be Applied For Same Sale Order. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Multiple price lists per order

+
+
+
+
+
+
+ +
+
+

Each line may have different price lists

+
+
+
+
+
+
+ +
+
+

View Margin in percentage.

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

You can enable multiple price list per order feature from configuration settings.

+
+
+
+
+
+
+ +
+
+

Configure different price lists.

+
+
+
+
+
+
+ +
+
+

Create and save sale order.

+
+
+
+ +
+
+
+ +
+
+

You can choose price list from the popup window by clicking the 'Apply Pricelist' button.

+
+
+
+
+
+
+ +
+
+

Price for that product is updated with that selected price list.

+
+
+
+
+
+
+ +
+
+

You can apply another price list for next order line of the same sale order.

+
+
+
+
+
+
+ +
+
+

You can apply another price list for next order line of the same sale order.

+
+
+
+
+
+
+ +
+
+

Price for that product is updated with that selected price list.

+
+
+
+
+
+
+ +
+
+

Unit prices as well as total and subtotal changed accordingly.

+
+
+
+
+
+
+
    +
  • + Multiple price lists per order. +
  • +
  • + Each line may have different price lists. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:4th July 2024 +
+

+ Initial Commit for Sale Order Multiple Pricelist.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Licensing Consultancy

+
+
+
+
+
+
+

Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

Education

+

A platform for educational management

+
+
+
+
+ +

Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service Management

+

Keep track of services and invoice

+
+
+
+
+ +

Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got questions or need help? Get in touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi to us on WhatsApp!

+
+91 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/multi_pricelist/views/res_config_settings_views.xml b/multi_pricelist/views/res_config_settings_views.xml new file mode 100644 index 000000000..e693566d4 --- /dev/null +++ b/multi_pricelist/views/res_config_settings_views.xml @@ -0,0 +1,19 @@ + + + + + res.config.settings.view.form.inherit.multi.pricelist + res.config.settings + + + + + + + + + + diff --git a/multi_pricelist/views/sale_order_views.xml b/multi_pricelist/views/sale_order_views.xml new file mode 100644 index 000000000..6faf34b8c --- /dev/null +++ b/multi_pricelist/views/sale_order_views.xml @@ -0,0 +1,21 @@ + + + + + sale.order.view.form.inherit.multi.pricelist + sale.order + + + + + + + + + + diff --git a/multi_pricelist/wizard/__init__.py b/multi_pricelist/wizard/__init__.py new file mode 100644 index 000000000..fd62f3134 --- /dev/null +++ b/multi_pricelist/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 pricelist_product +from . import pricelist_line diff --git a/multi_pricelist/wizard/pricelist_line.py b/multi_pricelist/wizard/pricelist_line.py new file mode 100644 index 000000000..8ff518187 --- /dev/null +++ b/multi_pricelist/wizard/pricelist_line.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 PricelistLine(models.TransientModel): + _name = 'pricelist.line' + _rec_name = 'wizard_id' + _description = 'Pricelist Lines' + + wizard_id = fields.Many2one('pricelist.product', + string="Price List Selection", + help="Price List Selection") + pricelist_id = fields.Many2one('product.pricelist', + string="PriceList", + help="Price lists that can be applied for " + "the order line.") + product_id = fields.Many2one('product.product', + string="Product", + help="Order line Product") + unit_price = fields.Float(string="Unit Price", + help="Price of the product per unit") + unit_cost = fields.Float(string='Unit Cost', + help="Cost of the product per unit") + margin = fields.Float(compute='_compute_margin', string="Margin %", + help="calculated by ((unit price - unit cost) " + "unit cost)* 100") + uom_id = fields.Many2one('uom.uom', string="UOM", help="Unit Of Measure") + + @api.depends('unit_price', 'unit_cost') + def _compute_margin(self): + """ This function will compute the margin for the product when the + price list applied. + It is calculated by ((unit price - unit cost)/ unit cost)* 100""" + for rec in self: + rec.margin = 100 + if rec.unit_cost: + rec.margin = ((rec.unit_price-rec.unit_cost)/rec.unit_cost)*100 + + def apply_pricelist(self): + """This function will apply the selected pricelist to the order + line.""" + for rec in self: + rec.wizard_id.order_line_id.update({ + 'applied_pricelist_id': rec.pricelist_id, + }) + rec.wizard_id.order_line_id.update({ + 'price_unit': rec.unit_price, + }) diff --git a/multi_pricelist/wizard/pricelist_product.py b/multi_pricelist/wizard/pricelist_product.py new file mode 100644 index 000000000..4df410426 --- /dev/null +++ b/multi_pricelist/wizard/pricelist_product.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (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 fields, models + + +class PricelistProduct(models.TransientModel): + """This class will create a new transient model for the price list wizard""" + _name = 'pricelist.product' + _rec_name = 'order_line_id' + _description = 'Price list product' + + order_line_id = fields.Many2one('sale.order.line', + string="Order Line", + help="Order line of the selected order") + line_ids = fields.One2many('pricelist.line', 'wizard_id', + string="Price lists", help="Pricelist lines") + + diff --git a/multi_pricelist/wizard/pricelist_product_views.xml b/multi_pricelist/wizard/pricelist_product_views.xml new file mode 100644 index 000000000..e722d84d6 --- /dev/null +++ b/multi_pricelist/wizard/pricelist_product_views.xml @@ -0,0 +1,38 @@ + + + + + pricelist.product.view.form + pricelist.product + +
+ +

+ Select one Pricelist +

+ + + + + + + + + +