diff --git a/custom_addons/cancellation_feature_cr/__init__.py b/custom_addons/cancellation_feature_cr/__init__.py
new file mode 100644
index 000000000..9b0292d05
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/__init__.py
@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from . import models
\ No newline at end of file
diff --git a/custom_addons/cancellation_feature_cr/__manifest__.py b/custom_addons/cancellation_feature_cr/__manifest__.py
new file mode 100644
index 000000000..f6c6c510c
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/__manifest__.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+{
+ 'name': "Cancellation Order Feature",
+ 'category': 'Sales/Sales',
+ 'summary': """ Cancellation Feature for Sales Order, Purchase Order, Inventory and Invoice.""",
+ 'version': '18.0.0.0',
+ 'author': "CandidRoot Solutions Pvt. Ltd.",
+ 'website': 'https://www.candidroot.com/',
+ 'sequence': 2,
+ 'description': """ This module will help you to do the following things in simple way.
+
+ --- You need to configure the options available in Sales/Configuration/Settings and Purchase/Configuration/Setting ---.
+
+Sale
+------------------------
+> You can cancel a Sale order, once it is confirmed.
+> After cancellation of order, product quantity will be reverted in inventory.
+ NOTE --> ( If you enabled the [Cancel Delivery Order] option in Sale's configuration then the quantity will be affected,
+ otherwise only Sale order will be cancelled.)
+> You can cancel multiple Sale orders in one click.
+> You can cancel sale's invoice
+ NOTE --> ( If you enabled the [Cancel Invoice and Payment] option in Sale configuration then invoice
+ will be cancelled.)
+
+Purchase
+------------------------
+> You can cancel a Purchase order, once it is confirmed.
+> After cancellation of order, product quantity will be revert in inventory.
+ NOTE --> ( If you checked [Cancel Receipt Order] option in Purchase configuration then the quantity will be affected,
+ otherwise only Purchase order will cancel.)
+> You can cancel multiple Purchase orders in one click.
+> You can cancel Purchase's invoice
+ NOTE --> ( If you checked [Cancel Bill] option in Purchase's configuration then invoice
+ will cancel.)
+
+Inventory
+------------------------
+> You can cancel Delivery order, Receipt and Internal Transfer which are in done state only.
+> NOTE --> ( If you checked [Stock Picking Cancel Operation Type] option in Inventory configuration
+ then it will be cancelled.)
+> You can cancel multiple Delivery order, Receipt and Internal Transfer in one click.
+> You can cancel multiple Stock moves.
+> NOTE --> You can find stock move from (Inventory > Reporting > Stock Moves)
+
+Invoice
+------------------------
+> You can cancel Invoice/Bill which are in Posted state.
+> If you cancel a Invoice/Bill then corresponding payment will also be cancelled if payment is in posted state.
+> You can also cancel Payment which are already Posted.
+
+ """,
+ 'depends': ["base", "sale_stock", "account", "sale_management", "sale", "purchase"],
+ 'data': [
+ 'security/security.xml',
+ 'data/ir_actions_server.xml',
+ 'views/stock_view.xml',
+ 'views/invoice_view.xml',
+ 'views/sale_settings_view.xml',
+ 'views/purchase_settings_view.xml',
+ 'views/inventory_settings_view.xml',
+ 'views/invoice_settings_view.xml',
+ ],
+ 'qweb': [],
+ 'images': ['static/description/banner.jpeg'],
+ 'installable': True,
+ 'live_test_url': 'https://youtu.be/Ibq81e7GRSQ',
+ 'license': 'LGPL-3',
+ 'auto_install': False,
+ 'application': False,
+}
diff --git a/custom_addons/cancellation_feature_cr/data/ir_actions_server.xml b/custom_addons/cancellation_feature_cr/data/ir_actions_server.xml
new file mode 100644
index 000000000..8dbe5acc2
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/data/ir_actions_server.xml
@@ -0,0 +1,173 @@
+
+
+
+
+
+ Sale Order Cancel
+ ir.actions.server
+
+
+ code
+ records.so_cancel_server_action_method()
+
+
+
+ Sale Order Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.so_cancel_draft_server_action_method()
+
+
+
+ Sale Order Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.so_cancel_delete_server_action_method()
+
+
+
+
+ Purchase Order Cancel
+ ir.actions.server
+
+
+ code
+ records.po_cancel_server_action_method()
+
+
+
+ Purchase Order Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.po_cancel_draft_server_action_method()
+
+
+
+ Purchase Order Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.po_cancel_delete_server_action_method()
+
+
+
+
+ Stock Form Cancel
+ ir.actions.server
+
+
+ code
+ records.stock_picking_cancel_server_action_method()
+
+
+
+ Stock Form Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.stock_picking_cancel_draft_server_action_method()
+
+
+
+ Stock Form Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.stock_picking_cancel_delete_server_action_method()
+
+
+
+
+ Stock Move Cancel
+ ir.actions.server
+
+
+ code
+ records.stock_move_cancel_server_action_method()
+
+
+
+ Stock Move Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.stock_move_cancel_draft_server_action_method()
+
+
+
+ Stock Move Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.stock_move_cancel_delete_server_action_method()
+
+
+
+
+ Invoice Cancel
+ ir.actions.server
+
+
+ code
+ records.account_move_cancel_server_action_method()
+
+
+
+ Invoice Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.account_move_cancel_draft_server_action_method()
+
+
+
+ Invoice Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.account_move_cancel_delete_server_action_method()
+
+
+
+
+ Payment Cancel
+ ir.actions.server
+
+
+ code
+ records.account_payment_cancel_server_action_method()
+
+
+
+ Payment Cancel & Draft
+ ir.actions.server
+
+
+ code
+ records.account_payment_cancel_draft_server_action_method()
+
+
+
+ Payment Cancel & Delete
+ ir.actions.server
+
+
+ code
+ action = records.account_payment_cancel_delete_server_action_method()
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/models/__init__.py b/custom_addons/cancellation_feature_cr/models/__init__.py
new file mode 100755
index 000000000..a95b17643
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/__init__.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from . import sale_order
+from . import res_config_settings
+from . import purchase_order
+from . import stock_picking
+from . import stock_move
+from . import account_move
+from . import account_payment
diff --git a/custom_addons/cancellation_feature_cr/models/account_move.py b/custom_addons/cancellation_feature_cr/models/account_move.py
new file mode 100644
index 000000000..4a105e64a
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/account_move.py
@@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class AccountMove(models.Model):
+ _inherit = "account.move"
+
+ def action_for_all_operations(self, invoice_cancel_type):
+ account_payment_object = self.env['account.payment'].sudo()
+ for rec in self:
+ payments = account_payment_object.search([('ref', '=', rec.name), ('state', '=', 'posted')])
+ if invoice_cancel_type == 'cancel':
+ for payment in payments:
+ payment.state = 'draft'
+ payment.state = 'cancel'
+ rec.button_draft()
+ # rec.button_cancel()
+
+ elif invoice_cancel_type == 'cancel_reset':
+ for payment in payments:
+ payment.state = 'draft'
+ payment.state = 'cancel'
+ rec.button_draft()
+
+ elif invoice_cancel_type == 'cancel_delete':
+ for payment in payments:
+ payment.action_draft()
+ payment.action_cancel()
+ payment.unlink()
+ rec.state = 'draft'
+ rec.state = 'cancel'
+ rec.write({'name': ''})
+ rec.unlink()
+
+ # CANCEL BUTTON METHOD
+ def button_cancel(self):
+ invoice_cancel_type = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.invoice_cancel_type')
+
+ self.action_for_all_operations(invoice_cancel_type)
+
+ if invoice_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('account.action_move_out_invoice_type')
+ action['tag'] = 'reload'
+ return action
+
+ if invoice_cancel_type and not invoice_cancel_type == 'cancel_reset' or not invoice_cancel_type:
+ res = super(AccountMove, self).button_cancel()
+ return res
+
+ # SERVER ACTIONS METHODS
+ def account_move_cancel_server_action_method(self):
+ invoice_cancel_type = 'cancel'
+
+ self.action_for_all_operations(invoice_cancel_type)
+
+ def account_move_cancel_draft_server_action_method(self):
+ invoice_cancel_type = 'cancel_reset'
+
+ self.action_for_all_operations(invoice_cancel_type)
+
+ def account_move_cancel_delete_server_action_method(self):
+ invoice_cancel_type = 'cancel_delete'
+
+ self.action_for_all_operations(invoice_cancel_type)
+ if invoice_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('account.action_move_out_invoice_type')
+ return action
diff --git a/custom_addons/cancellation_feature_cr/models/account_payment.py b/custom_addons/cancellation_feature_cr/models/account_payment.py
new file mode 100644
index 000000000..5989e128a
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/account_payment.py
@@ -0,0 +1,64 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class AccountPayment(models.Model):
+ _inherit = "account.payment"
+
+ def action_for_all_operations(self, payment_cancel_type):
+ account_move_obj = self.env['account.move'].sudo()
+ for rec in self:
+ invoice = account_move_obj.search([('name', '=', rec.ref)])
+ if payment_cancel_type == 'cancel':
+ if rec.state == 'posted':
+ rec.state = 'draft'
+ rec.state = 'cancel'
+ invoice.button_draft()
+ invoice.button_cancel()
+
+ elif payment_cancel_type == 'cancel_reset':
+ if rec.state == 'posted':
+ rec.action_draft()
+ invoice.button_draft()
+
+ elif payment_cancel_type == 'cancel_delete':
+ if rec.state == 'posted':
+ rec.action_draft()
+ rec.action_cancel()
+ invoice.button_draft()
+ invoice.state = 'cancel'
+ rec.unlink()
+
+ # CANCEL BUTTON METHOD
+ def action_cancel(self):
+ payment_cancel_type = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.payment_cancel_type')
+
+ self.action_for_all_operations(payment_cancel_type)
+
+ if payment_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('account.action_account_payments')
+ action['tag'] = 'reload'
+ return action
+
+ # SERVER ACTIONS METHODS
+ def account_payment_cancel_server_action_method(self):
+ payment_cancel_type = 'cancel'
+
+ self.action_for_all_operations(payment_cancel_type)
+
+ def account_payment_cancel_draft_server_action_method(self):
+ payment_cancel_type = 'cancel_reset'
+
+ self.action_for_all_operations(payment_cancel_type)
+
+ def account_payment_cancel_delete_server_action_method(self):
+ payment_cancel_type = 'cancel_delete'
+
+ self.action_for_all_operations(payment_cancel_type)
+ if payment_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('account.action_account_payments')
+ return action
diff --git a/custom_addons/cancellation_feature_cr/models/purchase_order.py b/custom_addons/cancellation_feature_cr/models/purchase_order.py
new file mode 100644
index 000000000..4ed94f3ca
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/purchase_order.py
@@ -0,0 +1,94 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class PurchaseOrder(models.Model):
+ _inherit = "purchase.order"
+
+ def _cancel_order(self):
+ self.write({'state': 'cancel'})
+
+ def _draft_order(self):
+ self.write({'state': 'draft'})
+
+ def action_for_all_operations(self, po_cancel_type, cancel_receipt_order, cancel_bill_payment):
+ for rec in self:
+ # CANCELLING RECEIPT AND DEDUCT QUANTITYS
+ if cancel_receipt_order == 'True':
+ picking = self.picking_ids.filtered(lambda a: a.state == 'done')
+ for pick in picking:
+ for move_line in pick.move_ids_without_package:
+ move_line.quantity = 0
+ move_line.state = 'draft'
+ move_line.unlink()
+ for move in pick.move_ids_without_package:
+ move.state = 'draft'
+ move.is_locked = False
+ pick.state = 'cancel'
+
+ if cancel_bill_payment == 'True':
+ account_payment_object = self.env['account.payment'].sudo()
+ invoices = self.invoice_ids.filtered(lambda a: a.state == 'posted')
+ for invoice in invoices:
+ payments = account_payment_object.search([('ref', '=', invoice.name), ('state', '=', 'posted')])
+ invoice.state = 'cancel'
+ payments.state = 'cancel'
+
+ # CANCELLATION TYPES
+ if po_cancel_type == 'cancel':
+ rec._cancel_order()
+
+ elif po_cancel_type == 'cancel_reset':
+ rec._draft_order()
+
+ elif po_cancel_type == 'cancel_delete':
+ rec._cancel_order()
+
+ # BUTTON METHOD
+ def button_cancel(self):
+ po_cancel_type = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.po_cancel_type')
+ cancel_receipt_order = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_receipt_order')
+ cancel_bill_payment = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_bill_payment')
+
+ self.action_for_all_operations(po_cancel_type, cancel_receipt_order, cancel_bill_payment)
+
+ if po_cancel_type == 'cancel_delete':
+ self.unlink()
+ action = self.env["ir.actions.act_window"]._for_xml_id('purchase.purchase_rfq')
+ action['tag'] = 'reload'
+ return action
+
+ if po_cancel_type and not po_cancel_type == 'cancel_reset' or not po_cancel_type:
+ res = super(PurchaseOrder, self).button_cancel()
+ return res
+
+ # SERVER ACTIONS METHODS
+ def po_cancel_server_action_method(self):
+ po_cancel_type = 'cancel'
+ cancel_receipt_order = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_receipt_order')
+ cancel_bill_payment = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_bill_payment')
+
+ self.action_for_all_operations(po_cancel_type,cancel_receipt_order,cancel_bill_payment)
+
+ def po_cancel_draft_server_action_method(self):
+ po_cancel_type = 'cancel_reset'
+ cancel_receipt_order = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_receipt_order')
+ cancel_bill_payment = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_bill_payment')
+
+ self.action_for_all_operations(po_cancel_type, cancel_receipt_order, cancel_bill_payment)
+
+ def po_cancel_delete_server_action_method(self):
+ po_cancel_type = 'cancel_delete'
+ cancel_receipt_order = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_receipt_order')
+ cancel_bill_payment = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_bill_payment')
+
+ self.action_for_all_operations(po_cancel_type, cancel_receipt_order, cancel_bill_payment)
+ self.unlink()
+ action = self.env["ir.actions.act_window"]._for_xml_id('purchase.purchase_rfq')
+ action['tag'] = 'reload'
+ return action
diff --git a/custom_addons/cancellation_feature_cr/models/res_config_settings.py b/custom_addons/cancellation_feature_cr/models/res_config_settings.py
new file mode 100644
index 000000000..1c9a6f4fd
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/res_config_settings.py
@@ -0,0 +1,53 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class ResConfigSettings(models.TransientModel):
+ _inherit = "res.config.settings"
+
+ # SALE ORDER RELATED FIELDS
+ so_cancel_type = fields.Selection([('cancel', 'Cancel Only'), ('cancel_reset', 'Cancel and Reset to Draft'),
+ ('cancel_delete', 'Cancel and Delete')],
+ 'Sale Order Cancel Operation Type',
+ config_parameter='cancellation_feature_cr.so_cancel_type')
+
+ cancel_do = fields.Boolean(string='Cancel Delivery Order', config_parameter='cancellation_feature_cr.cancel_do')
+ cancel_invoice_payment = fields.Boolean(string='Cancel Invoice and Payment',
+ config_parameter='cancellation_feature_cr.cancel_invoice_payment')
+
+ # PURCHASE ORDER RELATED FIELDS
+ po_cancel_type = fields.Selection([('cancel', 'Cancel Only'), ('cancel_reset', 'Cancel and Reset to Draft'),
+ ('cancel_delete', 'Cancel and Delete')],
+ 'Purchase Order Cancel Operation Type',
+ config_parameter='cancellation_feature_cr.po_cancel_type')
+ cancel_receipt_order = fields.Boolean(string='Cancel Receipt Order',
+ config_parameter='cancellation_feature_cr.cancel_receipt_order')
+ cancel_bill_payment = fields.Boolean(string='Cancel Bill',
+ config_parameter='cancellation_feature_cr.cancel_bill_payment')
+
+ # INVENTORY RELATED FIELDS
+ # ---* STOCK PICKING OPERATIONS
+
+ stock_picking_cancel_type = fields.Selection(
+ [('cancel', 'Cancel Only'), ('cancel_reset', 'Cancel and Reset to Draft'),
+ ('cancel_delete', 'Cancel and Delete')],
+ 'Stock Picking Cancel Operation Type',
+ config_parameter='cancellation_feature_cr.stock_picking_cancel_type')
+
+ # INVOICE / ACCOUNT RELATED FIELDS
+ # ---* ACCOUNT MOVE OPERATIONS
+
+ invoice_cancel_type = fields.Selection(
+ [('cancel', 'Cancel Only'), ('cancel_reset', 'Cancel and Reset to Draft'),
+ ('cancel_delete', 'Cancel and Delete')],
+ 'Invoice Cancel Operation Type',
+ config_parameter='cancellation_feature_cr.invoice_cancel_type')
+
+ payment_cancel_type = fields.Selection(
+ [('cancel', 'Cancel Only'), ('cancel_reset', 'Cancel and Reset to Draft'),
+ ('cancel_delete', 'Cancel and Delete')],
+ 'Payment Cancel Operation Type',
+ config_parameter='cancellation_feature_cr.payment_cancel_type')
diff --git a/custom_addons/cancellation_feature_cr/models/sale_order.py b/custom_addons/cancellation_feature_cr/models/sale_order.py
new file mode 100644
index 000000000..affec9d0b
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/sale_order.py
@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class SaleOrder(models.Model):
+ _inherit = "sale.order"
+
+ def _cancel_order(self):
+ self.write({'state': 'cancel'})
+
+ def _draft_order(self):
+ self.write({'state': 'draft'})
+
+ def action_for_all_operations(self, so_cancel_type, cancel_delivery, cancel_invoice_payment):
+ for rec in self:
+ # CANCELLING OF DONE DELIVERY ORDER AND BRING QUANTITIES
+ if cancel_delivery == 'True':
+ picking = rec.picking_ids.filtered(lambda a: a.state == 'done')
+ for pick in rec.picking_ids:
+ for move in pick.move_ids_without_package:
+ move.quantity = 0
+ move.state = 'draft'
+ move.unlink()
+ for move in pick.move_ids_without_package:
+ move.state = 'draft'
+ move.is_locked = False
+ pick.do_unreserve()
+ pick.action_cancel()
+
+ if cancel_invoice_payment == 'True':
+ account_payment_object = self.env['account.payment'].sudo()
+ invoices = self.invoice_ids.filtered(lambda a: a.state == 'posted')
+ for invoice in invoices:
+ payments = account_payment_object.search([('ref', '=', invoice.name), ('state', '=', 'posted')])
+ invoice.state = 'cancel'
+ payments.state = 'cancel'
+
+ # CANCELLATION TYPES
+ if so_cancel_type == 'cancel':
+ rec._cancel_order()
+
+ elif so_cancel_type == 'cancel_reset':
+ rec._draft_order()
+
+ elif so_cancel_type == 'cancel_delete':
+ rec._cancel_order()
+
+ # BUTTON METHOD
+ def _action_cancel(self):
+ so_cancel_type = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.so_cancel_type')
+ cancel_delivery = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_do')
+ cancel_invoice_payment = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_invoice_payment')
+
+ self.action_for_all_operations(so_cancel_type, cancel_delivery, cancel_invoice_payment)
+ if so_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('sale.action_quotations_with_onboarding')
+ action['tag'] = 'reload'
+ self.unlink()
+ return action
+
+ if so_cancel_type and not so_cancel_type == 'cancel_reset' or not so_cancel_type:
+ res = super(SaleOrder, self)._action_cancel()
+ return res
+
+ # SERVER ACTIONS METHODS
+ def so_cancel_server_action_method(self):
+ so_cancel_type = 'cancel'
+ cancel_delivery = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_do')
+ cancel_invoice_payment = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_invoice_payment')
+
+ self.action_for_all_operations(so_cancel_type, cancel_delivery, cancel_invoice_payment)
+
+ def so_cancel_draft_server_action_method(self):
+ so_cancel_type = 'cancel_reset'
+ cancel_delivery = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_do')
+ cancel_invoice_payment = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_invoice_payment')
+
+ self.action_for_all_operations(so_cancel_type, cancel_delivery, cancel_invoice_payment)
+
+ def so_cancel_delete_server_action_method(self):
+ so_cancel_type = 'cancel_delete'
+ cancel_delivery = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr.cancel_do')
+ cancel_invoice_payment = self.env['ir.config_parameter'].sudo().get_param(
+ 'cancellation_feature_cr.cancel_invoice_payment')
+
+ self.action_for_all_operations(so_cancel_type, cancel_delivery, cancel_invoice_payment)
+
+ self.unlink()
+ action = self.env["ir.actions.act_window"]._for_xml_id('sale.action_quotations_with_onboarding')
+ action['tag'] = 'reload'
+ return action
diff --git a/custom_addons/cancellation_feature_cr/models/stock_move.py b/custom_addons/cancellation_feature_cr/models/stock_move.py
new file mode 100644
index 000000000..8a66da27f
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/stock_move.py
@@ -0,0 +1,142 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class StockMove(models.Model):
+ _inherit = "stock.move"
+
+ def _action_cancel_move(self):
+ self.write({'state': 'cancel'})
+
+ def _action_draft_move(self):
+ self.write({'state': 'draft'})
+
+ def action_for_all_operations(self, stock_picking_cancel_type):
+ for rec in self:
+ if stock_picking_cancel_type == 'cancel':
+ rec._action_cancel_move()
+
+ elif stock_picking_cancel_type == 'cancel_reset':
+ rec._action_draft_move()
+
+ elif stock_picking_cancel_type == 'cancel_delete':
+ rec._action_draft_move()
+ rec.unlink()
+
+ def set_stock_quant_quantity(self, move_qty, stock_move):
+ stock_quant_object = self.env['stock.quant']
+ product = stock_move.product_id
+ if stock_move.product_id.tracking == 'none':
+ out_stock_quant = stock_quant_object.sudo().search(
+ [('product_id', '=', product.id), ('location_id', '=', stock_move.location_id.id)])
+ if not out_stock_quant:
+ out_stock_quant = stock_quant_object.sudo().create({
+ 'product_id': product and product.id or False,
+ 'location_id': stock_move.location_id and stock_move.location_id.id or False,
+ 'quantity': 0,
+ 'product_uom_id': stock_move.product_uom and stock_move.product_uom.id or False,
+ })
+ if out_stock_quant:
+ out_stock_quant[0].quantity = out_stock_quant[0].quantity + move_qty
+ if out_stock_quant[0].quantity == 0:
+ out_stock_quant[0].unlink()
+
+ out_stock_quant = stock_quant_object.sudo().search(
+ [('product_id', '=', product.id), ('location_id', '=', stock_move.location_dest_id.id)])
+ if not out_stock_quant:
+ out_stock_quant = stock_quant_object.sudo().create({
+ 'product_id': product and product.id or False,
+ 'location_id': stock_move.location_id and stock_move.location_id.id or False,
+ 'quantity': 0,
+ 'product_uom_id': stock_move.product_uom and stock_move.product_uom.id or False,
+ })
+ if out_stock_quant:
+ out_stock_quant[0].quantity = out_stock_quant[0].quantity - move_qty
+ if out_stock_quant[0].quantity == 0:
+ out_stock_quant[0].unlink()
+
+ else:
+ for line in stock_move.move_line_ids:
+ out_stock_quant = stock_quant_object.sudo().search(
+ [('product_id', '=', product.id), ('location_id', '=', stock_move.location_id.id),
+ ('lot_id', '=', line.lot_id.id)])
+
+ if not out_stock_quant:
+ out_stock_quant = stock_quant_object.sudo().create({
+ 'product_id': product and product.id or False,
+ 'location_id': stock_move.location_id and stock_move.location_id.id or False,
+ 'quantity': 0,
+ 'product_uom_id': stock_move.product_uom and stock_move.product_uom.id or False,
+ 'lot_id': line.lot_id and line.lot_id.id or False,
+ })
+
+ if out_stock_quant:
+ out_stock_quant[0].quantity = out_stock_quant[0].quantity + line.qty_done
+ if out_stock_quant[0].quantity == 0:
+ out_stock_quant[0].unlink()
+
+ out_stock_quant = stock_quant_object.sudo().search(
+ [('product_id', '=', product.id), ('location_id', '=', stock_move.location_dest_id.id),
+ ('lot_id', '=', line.lot_id.id)])
+
+ if not out_stock_quant:
+ out_stock_quant = stock_quant_object.sudo().create({
+ 'product_id': product and product.id or False,
+ 'location_id': stock_move.location_id and stock_move.location_id.id or False,
+ 'quantity': 0,
+ 'product_uom_id': stock_move.product_uom and stock_move.product_uom.id or False,
+ 'lot_id': line.lot_id and line.lot_id.id or False,
+ })
+
+ if out_stock_quant:
+ out_stock_quant[0].quantity = out_stock_quant[0].quantity - line.qty_done
+ if out_stock_quant[0].quantity == 0:
+ out_stock_quant[0].unlink()
+
+ def set_order_line_quantity(self, stock_move, pick_operation_ids, picking_state):
+ for pack_operation_id in pick_operation_ids:
+ move_qty = stock_move.product_uom_qty
+ if stock_move.quantity_done:
+ move_qty = stock_move.quantity_done
+
+ if stock_move.quantity_done:
+ if stock_move.sale_line_id:
+ if stock_move.sale_line_id.qty_delivered >= move_qty:
+ stock_move.sale_line_id.qty_delivered = stock_move.sale_line_id.qty_delivered - move_qty
+ if stock_move.purchase_line_id:
+ if stock_move.purchase_line_id.qty_received >= move_qty:
+ stock_move.purchase_line_id.qty_received = stock_move.purchase_line_id.qty_received - move_qty
+ if stock_move.product_id.type == 'product':
+ self.set_stock_quant_quantity(move_qty, stock_move)
+
+ def _fetch_pickings(self):
+ for move in self:
+ picking_state = move.picking_id.state
+ if move.picking_id.state != 'done':
+ move._do_unreserve()
+ if move.picking_id.state == 'done' or 'confirmed' and move.picking_id.picking_type_id.code in ['incoming',
+ 'outgoing']:
+ pickings = self.env['stock.move'].sudo().search(
+ [('picking_id', '=', move.picking_id.id), ('product_id', '=', move.product_id.id)])
+
+ self.set_order_line_quantity(move, pickings, picking_state)
+
+ def stock_move_cancel_server_action_method(self):
+ stock_picking_cancel_type = 'cancel'
+ self._fetch_pickings()
+ self.action_for_all_operations(stock_picking_cancel_type)
+
+ def stock_move_cancel_draft_server_action_method(self):
+ stock_picking_cancel_type = 'cancel_reset'
+ self._fetch_pickings()
+ self.action_for_all_operations(stock_picking_cancel_type)
+
+ def stock_move_cancel_delete_server_action_method(self):
+ stock_picking_cancel_type = 'cancel_delete'
+ self._fetch_pickings()
+ self.action_for_all_operations(stock_picking_cancel_type)
+ action = self.env["ir.actions.act_window"]._for_xml_id('stock.stock_move_action')
+ return action
diff --git a/custom_addons/cancellation_feature_cr/models/stock_picking.py b/custom_addons/cancellation_feature_cr/models/stock_picking.py
new file mode 100644
index 000000000..6ac8b5b08
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/models/stock_picking.py
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+# Part of Odoo Module Developed by CandidRoot Solutions Pvt. Ltd.
+# See LICENSE file for full copyright and licensing details.
+
+from odoo import models, fields, api, _
+
+
+class Picking(models.Model):
+ _inherit = "stock.picking"
+
+ def _action_cancel(self):
+ self.write({'state': 'cancel'})
+
+ def _action_draft(self):
+ self.write({'state': 'draft'})
+
+ def action_for_all_operations(self, stock_picking_cancel_type):
+ for rec in self:
+ picking = rec.filtered(lambda a: a.state == 'done')
+ for pick in picking:
+ for move in pick.move_ids_without_package:
+ # for move_line in move.move_line_nosuggest_ids:
+ move.quantity = 0
+ move.state = 'draft'
+ move.unlink()
+ for move in pick.move_ids_without_package:
+ move.state = 'draft'
+ move.is_locked = False
+
+ if stock_picking_cancel_type == 'cancel':
+ rec._action_cancel()
+
+ elif stock_picking_cancel_type == 'cancel_reset':
+ rec._action_draft()
+
+ elif stock_picking_cancel_type == 'cancel_delete':
+ rec.unlink()
+
+ def action_cancel(self):
+ stock_picking_cancel_type = self.env['ir.config_parameter'].sudo().get_param('cancellation_feature_cr'
+ '.stock_picking_cancel_type')
+
+ self.action_for_all_operations(stock_picking_cancel_type)
+ if stock_picking_cancel_type == 'cancel_delete':
+ action = self.env["ir.actions.act_window"]._for_xml_id('stock.action_picking_tree_ready')
+ return action
+ res = super(Picking, self).action_cancel()
+ return res
+
+ # SERVER ACTIONS METHODS
+ def stock_picking_cancel_server_action_method(self):
+ stock_picking_cancel_type = 'cancel'
+
+ self.action_for_all_operations(stock_picking_cancel_type)
+
+ def stock_picking_cancel_draft_server_action_method(self):
+ stock_picking_cancel_type = 'cancel_reset'
+
+ self.action_for_all_operations(stock_picking_cancel_type)
+
+ def stock_picking_cancel_delete_server_action_method(self):
+ stock_picking_cancel_type = 'cancel_delete'
+
+ self.action_for_all_operations(stock_picking_cancel_type)
+ action = self.env["ir.actions.act_window"]._for_xml_id('stock.action_picking_tree_ready')
+ return action
diff --git a/custom_addons/cancellation_feature_cr/security/security.xml b/custom_addons/cancellation_feature_cr/security/security.xml
new file mode 100644
index 000000000..692d0136f
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/security/security.xml
@@ -0,0 +1,25 @@
+
+
+
+
+ Cancellation Groups
+ 100
+
+
+ Cancel Sale Orders
+
+
+
+ Cancel Purchase Orders
+
+
+
+ Cancel Inventory Orders
+
+
+
+ Cancel Invoice Orders
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/static/description/1.png b/custom_addons/cancellation_feature_cr/static/description/1.png
new file mode 100644
index 000000000..d55402a7b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/1.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/10.png b/custom_addons/cancellation_feature_cr/static/description/10.png
new file mode 100644
index 000000000..ec01a27b4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/10.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/11_c.png b/custom_addons/cancellation_feature_cr/static/description/11_c.png
new file mode 100644
index 000000000..fcfd67908
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/11_c.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/11a.png b/custom_addons/cancellation_feature_cr/static/description/11a.png
new file mode 100644
index 000000000..6690a418b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/11a.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/11b.png b/custom_addons/cancellation_feature_cr/static/description/11b.png
new file mode 100644
index 000000000..b9f6a302d
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/11b.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/11d.png b/custom_addons/cancellation_feature_cr/static/description/11d.png
new file mode 100644
index 000000000..1e6587840
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/11d.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/12.png b/custom_addons/cancellation_feature_cr/static/description/12.png
new file mode 100644
index 000000000..7c2b68c27
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/12.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/13.png b/custom_addons/cancellation_feature_cr/static/description/13.png
new file mode 100644
index 000000000..6050503f8
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/13.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/14.png b/custom_addons/cancellation_feature_cr/static/description/14.png
new file mode 100644
index 000000000..60212473f
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/14.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/2.png b/custom_addons/cancellation_feature_cr/static/description/2.png
new file mode 100644
index 000000000..76ad749ab
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/2.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/3.png b/custom_addons/cancellation_feature_cr/static/description/3.png
new file mode 100644
index 000000000..2bf743466
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/3.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/4.png b/custom_addons/cancellation_feature_cr/static/description/4.png
new file mode 100644
index 000000000..521bfa7a4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/4.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/5a.png b/custom_addons/cancellation_feature_cr/static/description/5a.png
new file mode 100644
index 000000000..a7e9da2d4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/5a.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/5b.png b/custom_addons/cancellation_feature_cr/static/description/5b.png
new file mode 100644
index 000000000..99b9f97ee
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/5b.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/5c.png b/custom_addons/cancellation_feature_cr/static/description/5c.png
new file mode 100644
index 000000000..299baa3fc
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/5c.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/5d.png b/custom_addons/cancellation_feature_cr/static/description/5d.png
new file mode 100644
index 000000000..cf01cc67b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/5d.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/6.png b/custom_addons/cancellation_feature_cr/static/description/6.png
new file mode 100644
index 000000000..8d9f94827
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/6.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/7.png b/custom_addons/cancellation_feature_cr/static/description/7.png
new file mode 100644
index 000000000..647c3f50d
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/7.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/8.png b/custom_addons/cancellation_feature_cr/static/description/8.png
new file mode 100644
index 000000000..7e162b6d7
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/8.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/9.png b/custom_addons/cancellation_feature_cr/static/description/9.png
new file mode 100644
index 000000000..6b3f920fe
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/9.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/after_cancelling_so.png b/custom_addons/cancellation_feature_cr/static/description/after_cancelling_so.png
new file mode 100644
index 000000000..a7e9da2d4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/after_cancelling_so.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/banner.jpeg b/custom_addons/cancellation_feature_cr/static/description/banner.jpeg
new file mode 100644
index 000000000..bb6280f93
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/banner.jpeg differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/cancelled_po_image.png b/custom_addons/cancellation_feature_cr/static/description/cancelled_po_image.png
new file mode 100644
index 000000000..6690a418b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/cancelled_po_image.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/click_cancel&_delete.png b/custom_addons/cancellation_feature_cr/static/description/click_cancel&_delete.png
new file mode 100644
index 000000000..7e162b6d7
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/click_cancel&_delete.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/click_cancel&_draft.png b/custom_addons/cancellation_feature_cr/static/description/click_cancel&_draft.png
new file mode 100644
index 000000000..8d9f94827
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/click_cancel&_draft.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/click_cancel_so.png b/custom_addons/cancellation_feature_cr/static/description/click_cancel_so.png
new file mode 100644
index 000000000..521bfa7a4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/click_cancel_so.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/click_po_cancel.png b/custom_addons/cancellation_feature_cr/static/description/click_po_cancel.png
new file mode 100644
index 000000000..ec01a27b4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/click_po_cancel.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/delivery_cancel.png b/custom_addons/cancellation_feature_cr/static/description/delivery_cancel.png
new file mode 100644
index 000000000..99b9f97ee
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/delivery_cancel.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/icon.png b/custom_addons/cancellation_feature_cr/static/description/icon.png
new file mode 100644
index 000000000..d38462643
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/icon.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/CMS.png b/custom_addons/cancellation_feature_cr/static/description/images/CMS.png
new file mode 100644
index 000000000..d7c6c63e2
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/CMS.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Consulting.png b/custom_addons/cancellation_feature_cr/static/description/images/Consulting.png
new file mode 100644
index 000000000..e7d5edf1c
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Consulting.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Customization.png b/custom_addons/cancellation_feature_cr/static/description/images/Customization.png
new file mode 100644
index 000000000..6e3d21d55
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Customization.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Development.png b/custom_addons/cancellation_feature_cr/static/description/images/Development.png
new file mode 100644
index 000000000..158fd1b5c
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Development.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/E-Commerce.png b/custom_addons/cancellation_feature_cr/static/description/images/E-Commerce.png
new file mode 100644
index 000000000..faf21f635
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/E-Commerce.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Implementation.png b/custom_addons/cancellation_feature_cr/static/description/images/Implementation.png
new file mode 100644
index 000000000..17a41a7a8
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Implementation.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Integration.png b/custom_addons/cancellation_feature_cr/static/description/images/Integration.png
new file mode 100644
index 000000000..6f66530c8
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Integration.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Mobile Application.png b/custom_addons/cancellation_feature_cr/static/description/images/Mobile Application.png
new file mode 100644
index 000000000..cbc77e286
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Mobile Application.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Odoo Support.png b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Support.png
new file mode 100644
index 000000000..8f81e22c7
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Support.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Odoo Theme Development.png b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Theme Development.png
new file mode 100644
index 000000000..c202c29a4
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Theme Development.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/Odoo Training.png b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Training.png
new file mode 100644
index 000000000..366d37c4a
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/Odoo Training.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/icon.png b/custom_addons/cancellation_feature_cr/static/description/images/icon.png
new file mode 100644
index 000000000..4f07b517c
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/icon.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/migration.png b/custom_addons/cancellation_feature_cr/static/description/images/migration.png
new file mode 100644
index 000000000..bd87149c8
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/migration.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/images/youtube2.png b/custom_addons/cancellation_feature_cr/static/description/images/youtube2.png
new file mode 100644
index 000000000..cd372e809
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/images/youtube2.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/index.html b/custom_addons/cancellation_feature_cr/static/description/index.html
new file mode 100644
index 000000000..4c7eae120
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/static/description/index.html
@@ -0,0 +1,589 @@
+
+
+
+
+
+
+
+ Community
+ Enterprise
+
+
+
+
+
+
+
+
+ Cancellation Order Feature
+
+
+
+
+
+ Enable cancellation functionality for Sales Order , Purchase Order , Inventory , and Invoice using this
+ module.
+
+
+
+
+
+
+
+
+
+ 01
+
+
+
+ Access the sales order , then click on any specific order within it.
+
+
+
+
+
+
+
+
+
+
+
+ 02
+
+
+
+ Access cancellation groups.
+
+
+
+
+
+
+
+
+
+
+
+ 03
+
+
+
+ If the "Cancel delivery order, Cancel Invoice & Payment " option is selected in the sale order
+ settings, canceling the sale order will also cancel the associated invoice, payment, and
+ delivery order.
+
+
+
+
+
+
+
+
+
+
+
+
+ 04
+
+
+
+ Click the sale order Cancel button to initiate the cancellation of the respective sales
+ order .
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 05
+
+
+
+ Upon clicking the sale order cancel button , the sale order , invoice , and payment in that state
+ will be canceled .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 06
+
+
+
+ Click on "Sale Order Cancel & Draft " to initiate the cancellation and return the sale order to
+ draft status .
+
+
+
+
+
+
+
+
+
+
+
+ 07
+
+
+
+ Clicking "Sale Order Cancel & Draft " transitions a canceled sale order to the draft state; if the order is not canceled, the usual cancellation process occurs.
+
+
+
+
+
+
+
+
+
+
+
+ 08
+
+
+
+ Clicking "Sale Order Cancel & Delete " deletes an already canceled sale order; if not canceled,
+ the regular cancellation process is initiated.
+
+
+
+
+
+
+
+
+
+
+
+ 09
+
+
+
+ If the "Cancel Receipt Order & Cancel Bill " option is selected in the purchase order settings,
+ canceling the purchase order will also cancel the associated bill, payment, and receipt
+ order.
+
+
+
+
+
+
+
+
+
+
+
+ 10
+
+
+
+ Click the Purchase Order Cancel button to initiate the cancellation of the respective purchase
+ order.
+
+
+
+
+
+
+
+
+
+
+
+ 11
+
+
+
+ After clicking the purchase order cancel button, the purchase order , bill , receipt , and payment
+ in that state will be canceled .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 12
+
+
+
+ Click on "Purchase Order Cancel & Draft " to cancel the purchase order and return it to draft
+ status.
+
+
+
+
+
+
+
+
+
+
+
+ 13
+
+
+
+ Clicking "Purchase Order Cancel & Draft " transitions a canceled purchase order to a draft state;
+ if not canceled, the regular cancellation process occurs.
+
+
+
+
+
+
+
+
+
+
+
+ 14
+
+
+
+ Clicking "Purchase Order Cancel & Delete " deletes an already canceled purchase order; if not
+ canceled, the regular cancellation process is initiated.
+
+
+
+
+
+
+
+
+
+
+
+
Get Help From Us!
+
+
+
+
+
Our Services
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Please Follow Us On
+
+
diff --git a/custom_addons/cancellation_feature_cr/static/description/invoice_cancellation.png b/custom_addons/cancellation_feature_cr/static/description/invoice_cancellation.png
new file mode 100644
index 000000000..299baa3fc
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/invoice_cancellation.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/payment_cancellation.png b/custom_addons/cancellation_feature_cr/static/description/payment_cancellation.png
new file mode 100644
index 000000000..cf01cc67b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/payment_cancellation.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_bill_cancel.png b/custom_addons/cancellation_feature_cr/static/description/po_bill_cancel.png
new file mode 100644
index 000000000..b9f6a302d
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_bill_cancel.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_click_cancel&_draft.png b/custom_addons/cancellation_feature_cr/static/description/po_click_cancel&_draft.png
new file mode 100644
index 000000000..7c2b68c27
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_click_cancel&_draft.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_click_cancel_&delete.png b/custom_addons/cancellation_feature_cr/static/description/po_click_cancel_&delete.png
new file mode 100644
index 000000000..60212473f
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_click_cancel_&delete.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_configuration.png b/custom_addons/cancellation_feature_cr/static/description/po_configuration.png
new file mode 100644
index 000000000..6b3f920fe
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_configuration.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_payment_cancel.png b/custom_addons/cancellation_feature_cr/static/description/po_payment_cancel.png
new file mode 100644
index 000000000..1e6587840
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_payment_cancel.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/po_transfer_cancel.png b/custom_addons/cancellation_feature_cr/static/description/po_transfer_cancel.png
new file mode 100644
index 000000000..fcfd67908
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/po_transfer_cancel.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/quotation_state_so.png b/custom_addons/cancellation_feature_cr/static/description/quotation_state_so.png
new file mode 100644
index 000000000..647c3f50d
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/quotation_state_so.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/rfq_state_po.png b/custom_addons/cancellation_feature_cr/static/description/rfq_state_po.png
new file mode 100644
index 000000000..6050503f8
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/rfq_state_po.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/sale_config.png b/custom_addons/cancellation_feature_cr/static/description/sale_config.png
new file mode 100644
index 000000000..d55402a7b
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/sale_config.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/sale_order_img.png b/custom_addons/cancellation_feature_cr/static/description/sale_order_img.png
new file mode 100644
index 000000000..76ad749ab
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/sale_order_img.png differ
diff --git a/custom_addons/cancellation_feature_cr/static/description/so_configuration.png b/custom_addons/cancellation_feature_cr/static/description/so_configuration.png
new file mode 100644
index 000000000..2bf743466
Binary files /dev/null and b/custom_addons/cancellation_feature_cr/static/description/so_configuration.png differ
diff --git a/custom_addons/cancellation_feature_cr/views/inventory_settings_view.xml b/custom_addons/cancellation_feature_cr/views/inventory_settings_view.xml
new file mode 100644
index 000000000..3e9ddfb50
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/inventory_settings_view.xml
@@ -0,0 +1,31 @@
+
+
+
+ view.inventory.res.config.settings
+ res.config.settings
+
+
+
+ Stock Picking Operations Type
+
+
+
+
+
+ These 3 cancellation option are related with ( Cancel Picking ) Button.
+ this options will affect only the 'Done' state of receipt/delivery order/picking.
+ If you are going to cancel from action menu ,In that case Cancellation process will work based on your selected choice of action menu.
+
+
+
+
+
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/views/invoice_settings_view.xml b/custom_addons/cancellation_feature_cr/views/invoice_settings_view.xml
new file mode 100644
index 000000000..1f2658749
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/invoice_settings_view.xml
@@ -0,0 +1,54 @@
+
+
+
+ view.invoice.res.config.settings
+ res.config.settings
+
+
+
+ Invoice Cancel Configuration
+
+
+
+
+
+
+
+ These 3 cancellation option are related with ( Cancel Invoice ) Button.
+ this options will affect only the 'POSTED' state of invoice.
+ If you are going to cancel from action menu ,In that case Cancellation process will work
+ based on your selected choice of action menu.
+
+
+
+
+
+
+
+
+
+
+ These 3 cancellation option are related with ( Cancel Payment ) Button.
+ this options will affect only the 'POSTED' state of payment.
+ If you are going to cancel from action menu ,In that case Cancellation process will work
+ based on your selected choice of action menu.
+
+
+
+
+
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/views/invoice_view.xml b/custom_addons/cancellation_feature_cr/views/invoice_view.xml
new file mode 100644
index 000000000..d7b669c10
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/invoice_view.xml
@@ -0,0 +1,25 @@
+
+
+
+ account.move.inherit.form
+ account.move
+
+
+
+
+
+
+
+
+ account.payment.inherit.form
+ account.payment
+
+
+
+
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/views/purchase_settings_view.xml b/custom_addons/cancellation_feature_cr/views/purchase_settings_view.xml
new file mode 100644
index 000000000..359ec0a44
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/purchase_settings_view.xml
@@ -0,0 +1,48 @@
+
+
+
+ view.po.res.config.settings
+ res.config.settings
+
+
+
+ Purchase Order Cancel Configuration
+
+
+
+
+
+ If you cancel a purchase order from button then these 3 cancellation options are effected.
+ If you are going to cancel from action menu ,In that case Cancellation process will work based on your selected choice of action menu.
+
+
+
+
+
+
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/views/sale_settings_view.xml b/custom_addons/cancellation_feature_cr/views/sale_settings_view.xml
new file mode 100644
index 000000000..44fea323d
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/sale_settings_view.xml
@@ -0,0 +1,48 @@
+
+
+
+ view.so.res.config.settings
+ res.config.settings
+
+
+
+ Sale Order Cancel Configuration
+
+
+
+
+
+ If you cancel a sale order from button then these 3 cancellation options are effected.
+ If you are going to cancel from action menu ,In that case Cancellation process will work based on your selected choice of action menu.
+
+
+
+
+
+
+
+
+
+
diff --git a/custom_addons/cancellation_feature_cr/views/stock_view.xml b/custom_addons/cancellation_feature_cr/views/stock_view.xml
new file mode 100644
index 000000000..e32278c18
--- /dev/null
+++ b/custom_addons/cancellation_feature_cr/views/stock_view.xml
@@ -0,0 +1,13 @@
+
+
+
+ stock.picking.inherit.form
+ stock.picking
+
+
+
+
+
+
+
+