[REM] repair: remove unused repair.cancel wizard
Since 653d63153e,
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 <vfe@odoo.com>
This commit is contained in:
co-authored by
Victor Feyens
parent
40c2a124a1
commit
5337455c46
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
|
@@ -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
|
||||
|
||||
@@ -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'] = """
|
||||
<form string="Cancel Repair">
|
||||
<header>
|
||||
<button name="cancel_repair" string="_Yes" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-secondary" special="cancel"/>
|
||||
</header>
|
||||
<label string="Do you want to continue?"/>
|
||||
</form>
|
||||
"""
|
||||
return res
|
||||
@@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<!-- Cancel Repair -->
|
||||
|
||||
<record id="view_cancel_repair" model="ir.ui.view">
|
||||
<field name="name">Cancel Repair</field>
|
||||
<field name="model">repair.cancel</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Cancel Repair Order">
|
||||
<group>
|
||||
<span class="o_form_label">This operation will cancel the Repair process, but will not cancel it's Invoice. Do you want to continue?</span>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="cancel_repair" string="Yes" type="object" class="btn-primary"/>
|
||||
<button string="Cancel" class="btn-secondary" special="cancel" />
|
||||
</footer>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_cancel_repair" model="ir.actions.act_window">
|
||||
<field name="name">Cancel Repair Order</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">repair.cancel</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user