From 5337455c46d21ecfaee973c3ab15e98e9a5d552b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Voet=20=28ryv=29?= Date: Thu, 13 Feb 2020 08:23:16 +0000 Subject: [PATCH] [REM] repair: remove unused repair.cancel wizard Since 653d63153eaef0b35538a87ffc6e8bc373da1a80, the repair.cancel (before mrp.repair.cancel) is unused and the dedicated code of cancelling is in the repair.order model. Co-authored-by: Victor Feyens --- addons/repair/__manifest__.py | 1 - addons/repair/security/ir.model.access.csv | 1 - addons/repair/wizard/__init__.py | 1 - addons/repair/wizard/repair_cancel.py | 40 -------------------- addons/repair/wizard/repair_cancel_views.xml | 32 ---------------- 5 files changed, 75 deletions(-) delete mode 100644 addons/repair/wizard/repair_cancel.py delete mode 100644 addons/repair/wizard/repair_cancel_views.xml diff --git a/addons/repair/__manifest__.py b/addons/repair/__manifest__.py index 630dbc298b0..67319b240d3 100644 --- a/addons/repair/__manifest__.py +++ b/addons/repair/__manifest__.py @@ -25,7 +25,6 @@ The following topics are covered by this module: 'data': [ 'security/ir.model.access.csv', 'security/repair_security.xml', - 'wizard/repair_cancel_views.xml', 'wizard/repair_make_invoice_views.xml', 'wizard/stock_warn_insufficient_qty_views.xml', 'views/repair_views.xml', diff --git a/addons/repair/security/ir.model.access.csv b/addons/repair/security/ir.model.access.csv index 71d03880f13..d1c7ed737e5 100644 --- a/addons/repair/security/ir.model.access.csv +++ b/addons/repair/security/ir.model.access.csv @@ -5,6 +5,5 @@ access_repair_tag_user,Repair Tags user,model_repair_tags,stock.group_stock_user access_stock_production_lot_user,stock.production.lot user,stock.model_stock_production_lot,stock.group_stock_user,1,1,1,1 access_repair_line_user,repair.line user,model_repair_line,stock.group_stock_user,1,1,1,1 access_account_tax_user,account.tax,account.model_account_tax,stock.group_stock_user,1,1,1,1 -access_repair_cancel,access.repair.cancel,model_repair_cancel,stock.group_stock_user,1,1,1,0 access_repair_order_make_invoice,access.repair.order.make_invoice,model_repair_order_make_invoice,stock.group_stock_user,1,1,1,0 access_stock_warn_insufficient_qty_repair,access.stock.warn.insufficient.qty.repair,model_stock_warn_insufficient_qty_repair,stock.group_stock_user,1,1,1,0 diff --git a/addons/repair/wizard/__init__.py b/addons/repair/wizard/__init__.py index d28e5c48c47..42410e54822 100644 --- a/addons/repair/wizard/__init__.py +++ b/addons/repair/wizard/__init__.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import repair_cancel from . import repair_make_invoice from . import stock_warn_insufficient_qty diff --git a/addons/repair/wizard/repair_cancel.py b/addons/repair/wizard/repair_cancel.py deleted file mode 100644 index 918687b44df..00000000000 --- a/addons/repair/wizard/repair_cancel.py +++ /dev/null @@ -1,40 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, models, _ -from odoo.exceptions import UserError - - -class RepairCancel(models.TransientModel): - _name = 'repair.cancel' - _description = 'Cancel Repair' - - def cancel_repair(self): - if not self._context.get('active_id'): - return {'type': 'ir.actions.act_window_close'} - repair = self.env['repair.order'].browse(self._context['active_id']) - if repair.invoiced or repair.invoice_method == 'none': - repair.action_cancel() - else: - raise UserError(_('Repair order is not invoiced.')) - return {'type': 'ir.actions.act_window_close'} - - @api.model - def fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False): - res = super(RepairCancel, self).fields_view_get(view_id=view_id, view_type=view_type, toolbar=toolbar,submenu=submenu) - repair_id = self._context.get('active_id') - if not repair_id or self._context.get('active_model') != 'repair.order': - return res - - repair = self.env['repair.order'].browse(repair_id) - if not repair.invoiced: - res['arch'] = """ -
-
-
-