diff --git a/merge_rfq/README.rst b/merge_rfq/README.rst new file mode 100755 index 000000000..e67cb0e43 --- /dev/null +++ b/merge_rfq/README.rst @@ -0,0 +1,46 @@ +.. 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 + +Merge RFQ +========= +This module allow to merge Purchase order in RFQ state. + +Configuration +============= +- No additional configurations needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: Vishnu 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: ``__ diff --git a/merge_rfq/__init__.py b/merge_rfq/__init__.py new file mode 100644 index 000000000..a64aca8a7 --- /dev/null +++ b/merge_rfq/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu KP () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import wizard diff --git a/merge_rfq/__manifest__.py b/merge_rfq/__manifest__.py new file mode 100644 index 000000000..17129eeaa --- /dev/null +++ b/merge_rfq/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu KP () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'Merge RFQ', + 'version': '17.0.1.0.0', + 'category': 'Purchases', + 'summary': """This module merege two or more RFQ by cancelling or deleting + the others in RFQ and RFQ sent state.""", + 'description': """'Merge RFQ' is a module for Odoo 17 that allows users to + merge multiple Requests for Quotations (RFQs) into a single one by + cancelling or deleting the others in RFQ and RFQ sent state.""", + 'author': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['purchase'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/merge_rfq_wizard.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application':False, +} diff --git a/merge_rfq/doc/RELEASE_NOTES.md b/merge_rfq/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d0b3de325 --- /dev/null +++ b/merge_rfq/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 10.01.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit for Merge RFQ diff --git a/merge_rfq/security/ir.model.access.csv b/merge_rfq/security/ir.model.access.csv new file mode 100644 index 000000000..814635f4d --- /dev/null +++ b/merge_rfq/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_merge_rfq_user,access_merge_rfq_user,model_merge_rfq,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/merge_rfq/static/description/assets/icons/capture (1).png b/merge_rfq/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/merge_rfq/static/description/assets/icons/capture (1).png differ diff --git a/merge_rfq/static/description/assets/icons/check.png b/merge_rfq/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/merge_rfq/static/description/assets/icons/check.png differ diff --git a/merge_rfq/static/description/assets/icons/chevron.png b/merge_rfq/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/chevron.png differ diff --git a/merge_rfq/static/description/assets/icons/cogs.png b/merge_rfq/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/cogs.png differ diff --git a/merge_rfq/static/description/assets/icons/consultation.png b/merge_rfq/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/merge_rfq/static/description/assets/icons/consultation.png differ diff --git a/merge_rfq/static/description/assets/icons/ecom-black.png b/merge_rfq/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/ecom-black.png differ diff --git a/merge_rfq/static/description/assets/icons/education-black.png b/merge_rfq/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/merge_rfq/static/description/assets/icons/education-black.png differ diff --git a/merge_rfq/static/description/assets/icons/hotel-black.png b/merge_rfq/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/merge_rfq/static/description/assets/icons/hotel-black.png differ diff --git a/merge_rfq/static/description/assets/icons/img.png b/merge_rfq/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/img.png differ diff --git a/merge_rfq/static/description/assets/icons/license.png b/merge_rfq/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/merge_rfq/static/description/assets/icons/license.png differ diff --git a/merge_rfq/static/description/assets/icons/lifebuoy.png b/merge_rfq/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/merge_rfq/static/description/assets/icons/lifebuoy.png differ diff --git a/merge_rfq/static/description/assets/icons/manufacturing-black.png b/merge_rfq/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/merge_rfq/static/description/assets/icons/manufacturing-black.png differ diff --git a/merge_rfq/static/description/assets/icons/photo-capture.png b/merge_rfq/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/photo-capture.png differ diff --git a/merge_rfq/static/description/assets/icons/pos-black.png b/merge_rfq/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/pos-black.png differ diff --git a/merge_rfq/static/description/assets/icons/puzzle.png b/merge_rfq/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/puzzle.png differ diff --git a/merge_rfq/static/description/assets/icons/restaurant-black.png b/merge_rfq/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/restaurant-black.png differ diff --git a/merge_rfq/static/description/assets/icons/service-black.png b/merge_rfq/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/merge_rfq/static/description/assets/icons/service-black.png differ diff --git a/merge_rfq/static/description/assets/icons/trading-black.png b/merge_rfq/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/merge_rfq/static/description/assets/icons/trading-black.png differ diff --git a/merge_rfq/static/description/assets/icons/training.png b/merge_rfq/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/merge_rfq/static/description/assets/icons/training.png differ diff --git a/merge_rfq/static/description/assets/icons/update.png b/merge_rfq/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/merge_rfq/static/description/assets/icons/update.png differ diff --git a/merge_rfq/static/description/assets/icons/user.png b/merge_rfq/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/merge_rfq/static/description/assets/icons/user.png differ diff --git a/merge_rfq/static/description/assets/icons/wrench.png b/merge_rfq/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/merge_rfq/static/description/assets/icons/wrench.png differ diff --git a/merge_rfq/static/description/assets/misc/Cybrosys R.png b/merge_rfq/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/merge_rfq/static/description/assets/misc/Cybrosys R.png differ diff --git a/merge_rfq/static/description/assets/misc/email.svg b/merge_rfq/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/merge_rfq/static/description/assets/misc/phone.svg b/merge_rfq/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/merge_rfq/static/description/assets/misc/star (1) 2.svg b/merge_rfq/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/merge_rfq/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/merge_rfq/static/description/assets/misc/support (1) 1.svg b/merge_rfq/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/merge_rfq/static/description/assets/misc/support-email.svg b/merge_rfq/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/merge_rfq/static/description/assets/misc/tick-mark.svg b/merge_rfq/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/merge_rfq/static/description/assets/misc/whatsapp 1.svg b/merge_rfq/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/merge_rfq/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/merge_rfq/static/description/assets/misc/whatsapp.svg b/merge_rfq/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/merge_rfq/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/merge_rfq/static/description/assets/modules/m1.png b/merge_rfq/static/description/assets/modules/m1.png new file mode 100644 index 000000000..acb4c76c6 Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m1.png differ diff --git a/merge_rfq/static/description/assets/modules/m2.png b/merge_rfq/static/description/assets/modules/m2.png new file mode 100644 index 000000000..3ef91f771 Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m2.png differ diff --git a/merge_rfq/static/description/assets/modules/m3.png b/merge_rfq/static/description/assets/modules/m3.png new file mode 100644 index 000000000..72febf6ae Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m3.png differ diff --git a/merge_rfq/static/description/assets/modules/m4.png b/merge_rfq/static/description/assets/modules/m4.png new file mode 100644 index 000000000..f7d7f9241 Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m4.png differ diff --git a/merge_rfq/static/description/assets/modules/m5.png b/merge_rfq/static/description/assets/modules/m5.png new file mode 100644 index 000000000..1d3324e88 Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m5.png differ diff --git a/merge_rfq/static/description/assets/modules/m6.png b/merge_rfq/static/description/assets/modules/m6.png new file mode 100644 index 000000000..80938c15a Binary files /dev/null and b/merge_rfq/static/description/assets/modules/m6.png differ diff --git a/merge_rfq/static/description/assets/screenshots/action_button.png b/merge_rfq/static/description/assets/screenshots/action_button.png new file mode 100644 index 000000000..b2cdc528d Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/action_button.png differ diff --git a/merge_rfq/static/description/assets/screenshots/cancel_other_merge_nw1_w.png b/merge_rfq/static/description/assets/screenshots/cancel_other_merge_nw1_w.png new file mode 100644 index 000000000..1cfec6c2c Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/cancel_other_merge_nw1_w.png differ diff --git a/merge_rfq/static/description/assets/screenshots/cancelled2nd.png b/merge_rfq/static/description/assets/screenshots/cancelled2nd.png new file mode 100644 index 000000000..6cec883cc Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/cancelled2nd.png differ diff --git a/merge_rfq/static/description/assets/screenshots/cancld&nwrfq.png b/merge_rfq/static/description/assets/screenshots/cancld&nwrfq.png new file mode 100644 index 000000000..390621c30 Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/cancld&nwrfq.png differ diff --git a/merge_rfq/static/description/assets/screenshots/hero.gif b/merge_rfq/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..410c6f32d Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/hero.gif differ diff --git a/merge_rfq/static/description/assets/screenshots/merge1to2&dlt1.png b/merge_rfq/static/description/assets/screenshots/merge1to2&dlt1.png new file mode 100644 index 000000000..e955fc9ac Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/merge1to2&dlt1.png differ diff --git a/merge_rfq/static/description/assets/screenshots/merged_orderline.png b/merge_rfq/static/description/assets/screenshots/merged_orderline.png new file mode 100644 index 000000000..1a6a2ca84 Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/merged_orderline.png differ diff --git a/merge_rfq/static/description/assets/screenshots/other_options.png b/merge_rfq/static/description/assets/screenshots/other_options.png new file mode 100644 index 000000000..87723910c Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/other_options.png differ diff --git a/merge_rfq/static/description/assets/screenshots/select2rfq.png b/merge_rfq/static/description/assets/screenshots/select2rfq.png new file mode 100644 index 000000000..93dc43113 Binary files /dev/null and b/merge_rfq/static/description/assets/screenshots/select2rfq.png differ diff --git a/merge_rfq/static/description/banner.jpg b/merge_rfq/static/description/banner.jpg new file mode 100644 index 000000000..686563477 Binary files /dev/null and b/merge_rfq/static/description/banner.jpg differ diff --git a/merge_rfq/static/description/icon.png b/merge_rfq/static/description/icon.png new file mode 100644 index 000000000..8c76bb883 Binary files /dev/null and b/merge_rfq/static/description/icon.png differ diff --git a/merge_rfq/static/description/index.html b/merge_rfq/static/description/index.html new file mode 100644 index 000000000..a1864dffe --- /dev/null +++ b/merge_rfq/static/description/index.html @@ -0,0 +1,865 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo SH +
+
+
+
+
+
+

+ Merge RFQ

+

+ Merge Purchase orders in RFQ state +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Odoo 17 Community & Enterprise Edition + Support.

+

Budget + management system in Odoo 17 Community & + Enterprise Edition. +

+
+
+
+
+
+
+ +
+
+

+ Cancel order and create new one.

+

Cancel all + selected purchase order and Create new order. +

+
+
+
+
+
+
+ +
+
+

+ Delete and Create New one

+

Delete all + selected purchase order and Create new order. +

+
+
+
+
+
+
+ +
+
+

+ Merge Into Selected one

+

Merge order on + existing selected order and delete others. +

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

+ Select more than one RFQ

+
+ Select more than one RFQ to merge from the + Purchase module
+
+
+
+
+
+
+ +
+
+

+ Merge Orders Action

+
+ Select two or more purchase orders which is + in RFQ or RFQ sent state and in 'Action' tab + there is an option 'Merge Orders'.
+
+
+
+
+
+
+ +
+
+

+ Merge Orders Wizard

+
+ When click on the Merge Orders in + 'Action' it will open a Wizard. + In the wizard there is four options in + Merge Type.
+ 1.Cancel all selected purchase order and + Create new order.
+ 2.Delete all selected purchase order and + Create new order.
+ 3.Merge order on existing selected order + and cancel others.
+ 4.Merge order on existing selected order + and delete others.
+
+
+
+
+
+
+ +
+
+

+ Merge order on existing selected order and + cancel/delete others

+
+ When select merge order on existing + selected order and cancel others there + is an option for selecting the RFQ and + click on button merge orders, + it will merge the order lines to the + selected RFQ and cancel others and if + select merge order on existing selected + order and delete others, it will merge + the + order lines to the selected RFQ and + delete others.
+
+
+
+
+
+
+ +
+
+

+ Merged and Cancelled Other

+
+ Merged the order lines to the + selected RFQ and cancelled the others
+
+
+
+
+
+
+ +
+
+

+ Merged Order line

+
+ Merged the order lines to the + selected RFQ
+
+
+
+ +
+
+
+ +
+
+

+ Cancel Selected And Create New one.

+
+ Cancel all selected purchase order and + Create new order.
+
+
+
+
+
+
+ +
+
+

+ Cancelled Orders With the New one

+
+ After selecting the "Cancel all selected + purchase order and + Create new order" it Will be like this.
+
+
+
+
+
+
+
    +
  • + Cancel all + selected purchase order and Create new order. +
  • +
  • + Merge order on + existing selected order and cancel others +
  • +
  • + Delete all + selected purchase order and Create new order +
  • +
  • + Merge order on + existing selected order and delete others +
  • + +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:10th Jan 2024 +
+

+ + Odoo 17 Merge RFQ.

+
+
+
+
+
+
+
+

+ 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/merge_rfq/wizard/__init__.py b/merge_rfq/wizard/__init__.py new file mode 100644 index 000000000..faeace076 --- /dev/null +++ b/merge_rfq/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu KP () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import merge_rfq_wizard diff --git a/merge_rfq/wizard/merge_rfq_wizard.py b/merge_rfq/wizard/merge_rfq_wizard.py new file mode 100644 index 000000000..8e90ca27e --- /dev/null +++ b/merge_rfq/wizard/merge_rfq_wizard.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Vishnu KP () +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# 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 (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from odoo import fields, models, _ +from odoo.exceptions import UserError + + +class MergeRfq(models.TransientModel): + """Creates the model merge.rfq for the wizard model""" + _name = 'merge.rfq' + _description = 'Merge RFQ' + + merge_type = fields.Selection(selection=[ + ('cancel_and_new', + 'Cancel all selected purchase order and Create new order'), + ('delete_and_new', + 'Delete all selected purchase order and Create new order'), + ('cancel_and_merge', + 'Merge order on existing selected order and cancel others'), + ('delete_and_merge', + 'Merge order on existing selected order and delete others')], + default='cancel_and_new', help='Select which type of merge is to done.' + ) + partner_id = fields.Many2one('res.partner', string='Vendor', + help='Select Vendor for new order') + purchase_order_ids = fields.Many2many('purchase.order', + string="Purchase Orders", + help="Selected Purchase Orders") + purchase_order_id = fields.Many2one('purchase.order', + string='Purchase Order', + help='Select RFQ to which others to ' + 'be merged') + + def action_merge_orders(self): + """This function merge the selected RFQs""" + purchase_orders = self.env["purchase.order"].browse( + self._context.get("active_ids", [])) + if len(self._context.get("active_ids", [])) < 2: + raise UserError(_("Please select at least two purchase orders.")) + if any(order.state not in ["draft", "sent"] for order in + purchase_orders): + raise UserError(_( + "Please select Purchase orders which are in RFQ or RFQ sent " + "state.")) + if self.merge_type in ['cancel_and_new', 'delete_and_new']: + new_po = self.env["purchase.order"].create( + {"partner_id": self.partner_id.id}) + for order in purchase_orders: + for line in order.order_line: + order_line = False + if new_po.order_line: + for new_line in new_po.order_line: + if (line.product_id == new_line.product_id and + line.price_unit == new_line.price_unit): + order_line = new_line + break + if order_line: + order_line.product_qty += line.product_qty + else: + line.copy(default={"order_id": new_po.id}) + for order in purchase_orders: + order.sudo().button_cancel() + if self.merge_type == "delete_and_new": + order.sudo().unlink() + else: + selected_po = self.purchase_order_id + for order in purchase_orders: + if order == selected_po: + continue + for line in order.order_line: + order_line = False + if selected_po.order_line: + for new_line in selected_po.order_line: + if (line.product_id == new_line.product_id and + line.price_unit == new_line.price_unit): + order_line = new_line + break + if order_line: + order_line.product_qty += line.product_qty + else: + line.copy( + default={"order_id": self.purchase_order_id.id}) + for order in purchase_orders: + if order != selected_po: + order.sudo().button_cancel() + if self.merge_type == "delete_and_merge": + order.sudo().unlink() diff --git a/merge_rfq/wizard/merge_rfq_wizard.xml b/merge_rfq/wizard/merge_rfq_wizard.xml new file mode 100644 index 000000000..104ab4b13 --- /dev/null +++ b/merge_rfq/wizard/merge_rfq_wizard.xml @@ -0,0 +1,39 @@ + + + + + merge.rfq.view.form + merge.rfq + +
+ + + + + + +
+
+
+
+
+ + + Merge RFQ + ir.actions.act_window + merge.rfq + form + + new + + list + {'default_purchase_order_ids' : active_ids} + +
\ No newline at end of file