diff --git a/pos_paid_order_delete/README.rst b/pos_paid_order_delete/README.rst new file mode 100644 index 000000000..6828653a8 --- /dev/null +++ b/pos_paid_order_delete/README.rst @@ -0,0 +1,49 @@ +.. 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 + +POS Paid Order Delete +===================== + This app allow the specified user to delete the pos orders in paid state. + +Installation +============ +- www.odoo.com/documentation/17.0/setup/install.html +- Install our custom addon + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/17.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Cybrosys Techno Solutions odoo@cybrosys.com + Version 17: Nisiya K @cybrosys + Version 18: Bhagyadev KP @cybrosys + +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/pos_paid_order_delete/__init__.py b/pos_paid_order_delete/__init__.py new file mode 100644 index 000000000..8aa4ff19b --- /dev/null +++ b/pos_paid_order_delete/__init__.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-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 +from odoo import api, SUPERUSER_ID + + +def _uninstall_hook(cr, registry): + env = api.Environment(cr, SUPERUSER_ID, {}) + env['ir.config_parameter'].sudo().set_param( + 'pos_paid_order_delete.is_delete', + False) diff --git a/pos_paid_order_delete/__manifest__.py b/pos_paid_order_delete/__manifest__.py new file mode 100644 index 000000000..f2b09ea4d --- /dev/null +++ b/pos_paid_order_delete/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-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': 'POS Paid Order Delete', + 'version': '18.0.1.0.0', + 'category': 'POS', + 'summary': "Can Delete POS Orders in Paid State With or Without Code", + 'description': "This app allow the specified user to delete the pos orders" + " with or without code in paid state by unlinking the " + "payments of corresponding order.", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['point_of_sale'], + 'data': + [ + 'security/ir.model.access.csv', + 'security/pos_order_delete_groups.xml', + 'data/pos_order_data.xml', + 'views/res_config_settings_views.xml', + 'wizard/delete_paid_pos_order_views.xml' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, + 'uninstall_hook': '_uninstall_hook', +} + diff --git a/pos_paid_order_delete/data/pos_order_data.xml b/pos_paid_order_delete/data/pos_order_data.xml new file mode 100644 index 000000000..a183226fc --- /dev/null +++ b/pos_paid_order_delete/data/pos_order_data.xml @@ -0,0 +1,15 @@ + + + + + Delete Paid Order + ir.actions.act_window + delete.paid.pos.order + form + new + action + list,form + + + + diff --git a/pos_paid_order_delete/doc/RELEASE_NOTES.md b/pos_paid_order_delete/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..9a941e336 --- /dev/null +++ b/pos_paid_order_delete/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 02.05.2025 +#### Version 18.0.1.0.0 +#### ADD +- Initial Commit for POS Paid Order Delete. diff --git a/pos_paid_order_delete/models/__init__.py b/pos_paid_order_delete/models/__init__.py new file mode 100644 index 000000000..5ae1723e9 --- /dev/null +++ b/pos_paid_order_delete/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-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 pos_order diff --git a/pos_paid_order_delete/models/pos_order.py b/pos_paid_order_delete/models/pos_order.py new file mode 100644 index 000000000..d615f566c --- /dev/null +++ b/pos_paid_order_delete/models/pos_order.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() + +# 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 models, _ +from odoo.addons.point_of_sale.models.pos_order import PosOrder +from odoo.exceptions import UserError +from odoo.tools import float_compare, formatLang + + +class PosOrderInherit(models.Model): + '''Inherit the pos.order model to override the write method''' + _inherit = 'pos.order' + _description = "POS Order Inherit" + + def write(self, vals): + '''Monkey patching the write method of pos.order to add extra condition for UserError''' + is_delete = (self.env['ir.config_parameter'].sudo().get_param('pos_paid_order_delete.is_delete')) + for order in self: + if vals.get('state') and vals['state'] == 'paid' and order.name == '/': + vals['name'] = self._compute_order_name() + if vals.get('mobile'): + vals['mobile'] = order._phone_format(number=vals.get('mobile'), + country=order.partner_id.country_id or self.env.company.country_id) + if vals.get('has_deleted_line') is not None and self.has_deleted_line: + del vals['has_deleted_line'] + allowed_vals = ['paid', 'done', 'invoiced'] + if vals.get('state') and vals['state'] not in allowed_vals and order.state in allowed_vals and not is_delete: + raise UserError(_('This order has already been paid. You cannot set it back to draft or edit it.')) + + list_line = self._create_pm_change_log(vals) + + res = super(PosOrder, self).write(vals) + for order in self: + if vals.get('payment_ids'): + order.with_context(backend_recomputation=True)._compute_prices() + totally_paid_or_more = float_compare(order.amount_paid, self._get_rounded_amount(order.amount_total), precision_rounding=order.currency_id.rounding) + if totally_paid_or_more < 0 and order.state in ['paid', 'done', 'invoiced']: + raise UserError(_('The paid amount is different from the total amount of the order.')) + elif totally_paid_or_more > 0 and order.state == 'paid': + list_line.append(_("Warning, the paid amount is higher than the total amount. (Difference: %s)", formatLang(self.env, order.amount_paid - order.amount_total, currency_obj=order.currency_id))) + if order.nb_print > 0 and vals.get('payment_ids'): + raise UserError(_('You cannot change the payment of a printed order.')) + + if len(list_line) > 0: + body = _("Payment changes:") + body += self._markup_list_message(list_line) + for order in self: + if vals.get('payment_ids'): + order.message_post(body=body) + return res + + PosOrder.write = write diff --git a/pos_paid_order_delete/models/res_config_settings.py b/pos_paid_order_delete/models/res_config_settings.py new file mode 100644 index 000000000..a272923f8 --- /dev/null +++ b/pos_paid_order_delete/models/res_config_settings.py @@ -0,0 +1,87 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-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, models, fields + + +class ResConfigSettings(models.TransientModel): + """Inheriting ResConfigSettings to add new fields""" + _inherit = 'res.config.settings' + + is_delete = fields.Boolean(string='Delete Paid Order', + help='Based on this selection it shows the ' + 'fields for deleting the paid pos order ' + 'with code and without code') + delete_paid_order = fields.Selection( + [('order_with_code', 'Delete POS order with code'), + ('order_without_code', 'Delete POS order without code')], + default='order_without_code', + string='Delete Paid Order', + store=True, + help='Delete the paid POS order with code or without providing the ' + 'code') + code = fields.Char(string='Code', help="Enter code to confirming " + "record deletion") + + @api.model + def get_values(self): + """Get values from the fields""" + res = super(ResConfigSettings, self).get_values() + params = self.env['ir.config_parameter'].sudo().get_param + is_delete = params('pos_paid_order_delete.is_delete') + delete_paid_order = params('pos_paid_order_delete.delete_paid_order') + code = params('pos_paid_order_delete.code') + res.update( + is_delete=is_delete, + delete_paid_order=delete_paid_order, + code=code, + ) + return res + + def set_values(self): + """Set values in the fields""" + super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].sudo().set_param( + 'pos_paid_order_delete.is_delete', + self.is_delete) + self.env['ir.config_parameter'].sudo().set_param( + 'pos_paid_order_delete.delete_paid_order', + self.delete_paid_order) + self.env['ir.config_parameter'].sudo().set_param( + 'pos_paid_order_delete.code', + self.code) + if self.is_delete: + self.env['ir.actions.act_window'].search([ + ('name', '=', 'Delete Paid Order')]).update( + {'binding_model_id': self.env['ir.model.data']._xmlid_to_res_id + ('point_of_sale.model_pos_order') + }) + else: + (self.env['ir.actions.act_window'].search([ + ('name', '=', 'Delete Paid Order')]).update + ({'binding_model_id': ''})) + + @api.onchange('is_delete') + def _onchange_is_delete(self): + """This function is used to st the value of code is None when we are + disabling the pos order delete field""" + if not self.is_delete: + self.code = None diff --git a/pos_paid_order_delete/security/ir.model.access.csv b/pos_paid_order_delete/security/ir.model.access.csv new file mode 100644 index 000000000..aff4ce1f2 --- /dev/null +++ b/pos_paid_order_delete/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_delete_paid_pos_order","delete.paid.pos.order","model_delete_paid_pos_order","base.group_user",1,1,1,1 diff --git a/pos_paid_order_delete/security/pos_order_delete_groups.xml b/pos_paid_order_delete/security/pos_order_delete_groups.xml new file mode 100644 index 000000000..6e51ee40e --- /dev/null +++ b/pos_paid_order_delete/security/pos_order_delete_groups.xml @@ -0,0 +1,9 @@ + + + + + + POS Order Delete + + + diff --git a/pos_paid_order_delete/static/description/assets/cybro-icon.png b/pos_paid_order_delete/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/cybro-icon.png differ diff --git a/pos_paid_order_delete/static/description/assets/cybro-odoo.png b/pos_paid_order_delete/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/cybro-odoo.png differ diff --git a/pos_paid_order_delete/static/description/assets/h2.png b/pos_paid_order_delete/static/description/assets/h2.png new file mode 100644 index 000000000..0bfc4707d Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/h2.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/arrows-repeat.svg b/pos_paid_order_delete/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-1.png b/pos_paid_order_delete/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/banner-1.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-2.svg b/pos_paid_order_delete/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-bg.png b/pos_paid_order_delete/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/banner-bg.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-bg.svg b/pos_paid_order_delete/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-call.svg b/pos_paid_order_delete/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-mail.svg b/pos_paid_order_delete/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-pattern.svg b/pos_paid_order_delete/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/banner-promo.svg b/pos_paid_order_delete/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/brand-pair.svg b/pos_paid_order_delete/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/check.png b/pos_paid_order_delete/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/check.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/chevron.png b/pos_paid_order_delete/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/chevron.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/close-icon.svg b/pos_paid_order_delete/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/cogs.png b/pos_paid_order_delete/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/cogs.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/collabarate-icon.svg b/pos_paid_order_delete/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/consultation.png b/pos_paid_order_delete/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/consultation.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/cybro-logo.png b/pos_paid_order_delete/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/cybro-logo.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/down.svg b/pos_paid_order_delete/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/pos_paid_order_delete/static/description/assets/icons/ecom-black.png b/pos_paid_order_delete/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/ecom-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/education-black.png b/pos_paid_order_delete/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/education-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/faq.png b/pos_paid_order_delete/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/faq.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/feature-icon.svg b/pos_paid_order_delete/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/feature.png b/pos_paid_order_delete/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/feature.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/gear.svg b/pos_paid_order_delete/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/hero.gif b/pos_paid_order_delete/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..380654dfe Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/hero.gif differ diff --git a/pos_paid_order_delete/static/description/assets/icons/hire-odoo.svg b/pos_paid_order_delete/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/hotel-black.png b/pos_paid_order_delete/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/hotel-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/license.png b/pos_paid_order_delete/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/license.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/life-ring-icon.svg b/pos_paid_order_delete/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/lifebuoy.png b/pos_paid_order_delete/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/lifebuoy.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/mail.svg b/pos_paid_order_delete/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/manufacturing-black.png b/pos_paid_order_delete/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/manufacturing-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/notes.png b/pos_paid_order_delete/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/notes.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/notification icon.svg b/pos_paid_order_delete/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/odoo-consultancy.svg b/pos_paid_order_delete/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/odoo-licencing.svg b/pos_paid_order_delete/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/odoo-logo.png b/pos_paid_order_delete/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/odoo-logo.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/patter.svg b/pos_paid_order_delete/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/pattern1.png b/pos_paid_order_delete/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/pattern1.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/pos-black.png b/pos_paid_order_delete/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/pos-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/puzzle-piece-icon.svg b/pos_paid_order_delete/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/puzzle.png b/pos_paid_order_delete/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/puzzle.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/replace-icon.svg b/pos_paid_order_delete/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/restaurant-black.png b/pos_paid_order_delete/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/restaurant-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/screenshot-main.png b/pos_paid_order_delete/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/screenshot-main.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/screenshot.png b/pos_paid_order_delete/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/screenshot.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/service-black.png b/pos_paid_order_delete/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/service-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/skype-fill.svg b/pos_paid_order_delete/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/skype.png b/pos_paid_order_delete/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/skype.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/skype.svg b/pos_paid_order_delete/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/star-1.svg b/pos_paid_order_delete/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/star-2.svg b/pos_paid_order_delete/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/support.png b/pos_paid_order_delete/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/support.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/test-1 - Copy.png b/pos_paid_order_delete/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/test-1 - Copy.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/test-1.png b/pos_paid_order_delete/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/test-1.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/test-2.png b/pos_paid_order_delete/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/test-2.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/trading-black.png b/pos_paid_order_delete/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/trading-black.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/training.png b/pos_paid_order_delete/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/training.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/translate.svg b/pos_paid_order_delete/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/update.png b/pos_paid_order_delete/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/update.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/user.png b/pos_paid_order_delete/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/user.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/video.png b/pos_paid_order_delete/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/video.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/whatsapp.png b/pos_paid_order_delete/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/whatsapp.png differ diff --git a/pos_paid_order_delete/static/description/assets/icons/wrench-icon.svg b/pos_paid_order_delete/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/pos_paid_order_delete/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pos_paid_order_delete/static/description/assets/icons/wrench.png b/pos_paid_order_delete/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/icons/wrench.png differ diff --git a/pos_paid_order_delete/static/description/assets/modules/1.gif b/pos_paid_order_delete/static/description/assets/modules/1.gif new file mode 100644 index 000000000..ae3a880a2 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/1.gif differ diff --git a/pos_paid_order_delete/static/description/assets/modules/2.gif b/pos_paid_order_delete/static/description/assets/modules/2.gif new file mode 100644 index 000000000..d19e2b352 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/2.gif differ diff --git a/pos_paid_order_delete/static/description/assets/modules/3.png b/pos_paid_order_delete/static/description/assets/modules/3.png new file mode 100644 index 000000000..8513873ea Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/3.png differ diff --git a/pos_paid_order_delete/static/description/assets/modules/4.png b/pos_paid_order_delete/static/description/assets/modules/4.png new file mode 100644 index 000000000..3bedf7981 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/4.png differ diff --git a/pos_paid_order_delete/static/description/assets/modules/5.png b/pos_paid_order_delete/static/description/assets/modules/5.png new file mode 100644 index 000000000..0e311ca87 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/5.png differ diff --git a/pos_paid_order_delete/static/description/assets/modules/6.jpg b/pos_paid_order_delete/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/modules/6.jpg differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/1.png b/pos_paid_order_delete/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..f75cb8d11 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/1.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/2.png b/pos_paid_order_delete/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..075896de7 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/2.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/3.png b/pos_paid_order_delete/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..cb560942e Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/3.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/4.png b/pos_paid_order_delete/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..a73c51d0c Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/4.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/5.png b/pos_paid_order_delete/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..08153c39a Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/5.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/6.png b/pos_paid_order_delete/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..610da4b8f Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/6.png differ diff --git a/pos_paid_order_delete/static/description/assets/screenshots/hero.gif b/pos_paid_order_delete/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..cbdeb1fad Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/screenshots/hero.gif differ diff --git a/pos_paid_order_delete/static/description/assets/y18.jpg b/pos_paid_order_delete/static/description/assets/y18.jpg new file mode 100644 index 000000000..eea1714f2 Binary files /dev/null and b/pos_paid_order_delete/static/description/assets/y18.jpg differ diff --git a/pos_paid_order_delete/static/description/banner.jpg b/pos_paid_order_delete/static/description/banner.jpg new file mode 100644 index 000000000..40618f0da Binary files /dev/null and b/pos_paid_order_delete/static/description/banner.jpg differ diff --git a/pos_paid_order_delete/static/description/icon.png b/pos_paid_order_delete/static/description/icon.png new file mode 100644 index 000000000..b164f63fd Binary files /dev/null and b/pos_paid_order_delete/static/description/icon.png differ diff --git a/pos_paid_order_delete/static/description/index.html b/pos_paid_order_delete/static/description/index.html new file mode 100644 index 000000000..ab79ba5dd --- /dev/null +++ b/pos_paid_order_delete/static/description/index.html @@ -0,0 +1,980 @@ + + + + + + POS Paid Order Delete + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

+ This app helps you to delete the POS orders in + paid state. +

+

POS Paid Order Delete +

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

Key + Highlights

+
+
+
+
+ +
+
+ Allow the user to delete the single or + multiple POS order in paid state. +
+
+
+
+
+
+ +
+
+ Delete the pos order in paid state with + using the code or without using the code. +
+
+
+
+
+
+ +
+
+ Available in Odoo 18.0 Community and + Enterprise. + +
+
+
+
+
+ +
+
+
+ POS Paid Order Delete +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ + +

+
+
+

+ Go to Settings --> Users & Companies --> Users --> Enable POS Order Delete. To give permission to the user to delete the paid POS orders. +

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

+ + +

+
+
+

+ Go to Point of Sale --> Configuration --> Settings --> Enable the boolean field Delete Paid Order. +

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

+ + +

+
+
+

+ Choose with or without code, Enter a code if your going with code. +

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

+ + +

+
+
+

+ Go to Point of Sale --> Orders --> Orders --> Choose Order/Orders to delete --> Select the action 'Delete Paid Order'. + +

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

+ + +

+
+
+

+ Enter The Code and Click on 'Delete Paid Order'. + + +

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

+ + +

+
+
+

+Enter The Code and Click on 'Delete Paid Order'. + + +

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

+ + +

+
+
+

+ Shows a Confirmation Wizard if Your Going Without Code. +

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

+ Allow the user to delete the single or multiple POS order in paid state.

+
+ +
+
+
+
+
+
+ +
+

Delete the pos order in paid state with using the code or without using the code.

+
+
+
+
+
+
+
+ +
+

Available in Odoo 18.0 Community and Enterprise.

+
+
+
+
+
+ +
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 2nd May, 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • +
+
+
+
+
+
+
+
+
+
+ + + + + + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/pos_paid_order_delete/views/res_config_settings_views.xml b/pos_paid_order_delete/views/res_config_settings_views.xml new file mode 100644 index 000000000..71ec313e9 --- /dev/null +++ b/pos_paid_order_delete/views/res_config_settings_views.xml @@ -0,0 +1,43 @@ + + + + + + res.config.settings.view.form.inherit.purchase.serial.number + res.config.settings + + + +

Delete Paid Order

+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pos_paid_order_delete/wizard/__init__.py b/pos_paid_order_delete/wizard/__init__.py new file mode 100644 index 000000000..85f81af69 --- /dev/null +++ b/pos_paid_order_delete/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- 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 delete_paid_pos_order diff --git a/pos_paid_order_delete/wizard/delete_paid_pos_order.py b/pos_paid_order_delete/wizard/delete_paid_pos_order.py new file mode 100644 index 000000000..daadc10b3 --- /dev/null +++ b/pos_paid_order_delete/wizard/delete_paid_pos_order.py @@ -0,0 +1,88 @@ +# -*- 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, models, fields, _ +from odoo.exceptions import UserError + + +class DeletePaidPosOrder(models.TransientModel): + '''Wizard to delete the paid pos orders''' + _name = "delete.paid.pos.order" + _description = "Delete Paid POS Order" + + pos_order_delete = fields.Boolean(string='Delete Paid Order', default=True, + help="Enable to delete POS orders") + code = fields.Char(string='Code', help="Setup code to enter " + "while deleting the POS order") + + @api.model + def default_get(self, fields): + """The function used to update the default values""" + is_delete = self.env['ir.config_parameter'].sudo().get_param( + 'pos_paid_order_delete.is_delete') + result = super(DeletePaidPosOrder, self).default_get(fields) + if is_delete: + delete_paid_order = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'pos_paid_order_delete.delete_paid_order') + result['pos_order_delete'] = delete_paid_order != 'order_with_code' + return result + + def delete_pos_paid_order(self): + """This function is used to delete the pos paid orders and the + corresponding payments""" + is_delete = (self.env['ir.config_parameter'].sudo(). + get_param('pos_paid_order_delete.is_delete')) + if is_delete: + delete_paid_order = (self.env['ir.config_parameter'].sudo(). + get_param('pos_paid_order_delete.' + 'delete_paid_order' + )) + pos_orders = self.env['pos.order'].browse(self.env.context.get + ('active_ids')) + code = self.env['ir.config_parameter'].sudo().get_param( + 'pos_paid_order_delete.code') + if delete_paid_order == 'order_with_code': + if code == self.code: + for order in pos_orders: + for payment in order.payment_ids: + payment.unlink() + order.write({'state': 'draft'}) + order.action_pos_order_cancel() + order.unlink() + else: + raise UserError("The code is wrong.Plase enter the " + "correct code") + else: + for order in pos_orders: + for payment in order.payment_ids: + payment.unlink() + order.write({'state': 'draft'}) + order.action_pos_order_cancel() + order.unlink() + return { + 'type': 'ir.actions.act_window', + 'name': _('Delete Pos Orders'), + 'res_model': 'pos.order', + 'view_mode': 'list', + 'view_id': self.env.ref('point_of_sale.view_pos_order_tree').id, + 'target': 'main', + } diff --git a/pos_paid_order_delete/wizard/delete_paid_pos_order_views.xml b/pos_paid_order_delete/wizard/delete_paid_pos_order_views.xml new file mode 100644 index 000000000..fac5f2729 --- /dev/null +++ b/pos_paid_order_delete/wizard/delete_paid_pos_order_views.xml @@ -0,0 +1,30 @@ + + + + + delete.paid.pos.order.view.form + delete.paid.pos.order + +
+ +
+

Are you sure you want to delete these records?

+
+
+

Please Enter the Code

+ + + + + +
+ + +
+
+