-
+
Repair products and invoice the repair orders
diff --git a/addons/repair/__manifest__.py b/addons/repair/__manifest__.py
index 5292d5f370c..53de470e3ba 100644
--- a/addons/repair/__manifest__.py
+++ b/addons/repair/__manifest__.py
@@ -25,17 +25,17 @@ The following topics are covered by this module:
'website': 'https://www.odoo.com/page/manufacturing',
'data': [
'security/ir.model.access.csv',
- 'security/mrp_repair_security.xml',
- 'wizard/mrp_repair_cancel_views.xml',
- 'wizard/mrp_repair_make_invoice_views.xml',
+ 'security/repair_security.xml',
+ 'wizard/repair_cancel_views.xml',
+ 'wizard/repair_make_invoice_views.xml',
'wizard/stock_warn_insufficient_qty_views.xml',
- 'views/mrp_repair_views.xml',
- 'report/mrp_repair_reports.xml',
- 'report/mrp_repair_templates_repair_order.xml',
+ 'views/repair_views.xml',
+ 'report/repair_reports.xml',
+ 'report/repair_templates_repair_order.xml',
'data/ir_sequence_data.xml',
- 'data/mrp_repair_data.xml',
+ 'data/repair_data.xml',
],
- 'demo': ['data/mrp_repair_demo.xml'],
+ 'demo': ['data/repair_demo.xml'],
'test': [],
'installable': True,
'auto_install': False,
diff --git a/addons/repair/data/ir_sequence_data.xml b/addons/repair/data/ir_sequence_data.xml
index 095afd57002..c432fed8391 100644
--- a/addons/repair/data/ir_sequence_data.xml
+++ b/addons/repair/data/ir_sequence_data.xml
@@ -1,9 +1,9 @@
-
+
Repair Order
- mrp.repair
+ repair.order
RMA/
5
diff --git a/addons/repair/data/repair_data.xml b/addons/repair/data/repair_data.xml
index 839b5729e23..8cfb5f4b0ec 100644
--- a/addons/repair/data/repair_data.xml
+++ b/addons/repair/data/repair_data.xml
@@ -3,13 +3,13 @@
-
- Mrp Repair Quotation - Send by Email
+
+ Repair Quotation - Send by Email
${(object.create_uid.email and '%s <%s>' % (object.create_uid.name, object.create_uid.email) or '')|safe}
${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' })
${object.partner_id.id}
-
-
+
+
${(object.name or '').replace('/','_')}
${object.partner_id.lang}
diff --git a/addons/repair/data/repair_demo.xml b/addons/repair/data/repair_demo.xml
index 70f59d33cdc..d96f28b1905 100644
--- a/addons/repair/data/repair_demo.xml
+++ b/addons/repair/data/repair_demo.xml
@@ -1,6 +1,6 @@
-
+
none
@@ -9,7 +9,7 @@
-
-
-
+
@@ -39,7 +39,7 @@
-
-
-
+
@@ -69,7 +69,7 @@
-
-
-
+
@@ -158,10 +158,10 @@
-
+
-
+
diff --git a/addons/repair/security/ir.model.access.csv b/addons/repair/security/ir.model.access.csv
index c367bf7249a..0cf2b767cb4 100644
--- a/addons/repair/security/ir.model.access.csv
+++ b/addons/repair/security/ir.model.access.csv
@@ -1,18 +1,18 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
-access_mrp_repair_fee_user,MRP Repair Fee user,model_mrp_repair_fee,stock.group_stock_user,1,1,1,1
-access_mrp_repair_fee_manager,MRP Repair Fee manager,model_mrp_repair_fee,stock.group_stock_manager,1,0,0,0
-access_mrp_repair_user,MRP Repair user,model_mrp_repair,stock.group_stock_user,1,1,1,1
-access_mrp_repair_manager,MRP Repair manager,model_mrp_repair,stock.group_stock_manager,1,0,0,0
+access_repair_fee_user,Repair Fee user,model_repair_fee,stock.group_stock_user,1,1,1,1
+access_repair_fee_manager,Repair Fee manager,model_repair_fee,stock.group_stock_manager,1,0,0,0
+access_repair_user,Repair user,model_repair_order,stock.group_stock_user,1,1,1,1
+access_repair_manager,Repair manager,model_repair_order,stock.group_stock_manager,1,0,0,0
access_product_pricelist_manager,product.pricelist manager,product.model_product_pricelist,stock.group_stock_manager,1,0,0,0
access_product_pricelist_user,product.pricelist user,product.model_product_pricelist,stock.group_stock_user,1,1,1,1
access_stock_production_lot_user,stock.production.lot user,stock.model_stock_production_lot,stock.group_stock_user,1,1,1,1
access_stock_production_lot_manager,stock.production.lot manager,stock.model_stock_production_lot,stock.group_stock_manager,1,0,0,0
-access_mrp_repair_line_user,mrp.repair.line user,model_mrp_repair_line,stock.group_stock_user,1,1,1,1
-access_mrp_repair_line_manager,mrp.repair.line manager,model_mrp_repair_line,stock.group_stock_manager,1,0,0,0
+access_repair_line_user,repair.line user,model_repair_line,stock.group_stock_user,1,1,1,1
+access_repair_line_manager,repair.line manager,model_repair_line,stock.group_stock_manager,1,0,0,0
access_account_tax_user,account.tax,account.model_account_tax,stock.group_stock_user,1,1,1,1
access_account_tax_manager,account.tax manager,account.model_account_tax,stock.group_stock_manager,1,0,0,0
-access_mrp_repair_fee_user_mrp,MRP Repair Fee user mrp,model_mrp_repair_fee,stock.group_stock_user,1,1,1,1
-access_mrp_repair_fee_mgr,MRP Repair Fee mgr,model_mrp_repair_fee,stock.group_stock_manager,1,0,0,0
+access_repair_fee_user_mrp,Repair Fee user mrp,model_repair_fee,stock.group_stock_user,1,1,1,1
+access_repair_fee_mgr,Repair Fee mgr,model_repair_fee,stock.group_stock_manager,1,0,0,0
access_account_invoice_user,account.invoice,account.model_account_invoice,stock.group_stock_user,1,1,1,1
access_account_invoice_manager,account.invoice manager,account.model_account_invoice,stock.group_stock_manager,1,0,0,0
access_account_invoice_line_user,account.invoice.line,account.model_account_invoice_line,stock.group_stock_user,1,1,1,1
diff --git a/addons/repair/security/repair_security.xml b/addons/repair/security/repair_security.xml
index 99afbc61f89..a87302b6418 100644
--- a/addons/repair/security/repair_security.xml
+++ b/addons/repair/security/repair_security.xml
@@ -3,9 +3,9 @@
-
- mrp_repair multi-company
-
+
+ repair multi-company
+
['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]
diff --git a/addons/repair/tests/__init__.py b/addons/repair/tests/__init__.py
index 0d6a3e371eb..19767c49aa3 100644
--- a/addons/repair/tests/__init__.py
+++ b/addons/repair/tests/__init__.py
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from . import test_mrp_repair
+from . import test_repair
diff --git a/addons/repair/tests/test_repair.py b/addons/repair/tests/test_repair.py
index b8f9a7e1685..d3a513916b9 100644
--- a/addons/repair/tests/test_repair.py
+++ b/addons/repair/tests/test_repair.py
@@ -4,115 +4,115 @@
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
-class TestMrpRepair(AccountingTestCase):
+class TestRepair(AccountingTestCase):
def setUp(self):
- super(TestMrpRepair, self).setUp()
+ super(TestRepair, self).setUp()
- self.MrpRepair = self.env['mrp.repair']
+ self.Repair = self.env['repair.order']
self.ResUsers = self.env['res.users']
- self.MrpRepairMakeInvoice = self.env['mrp.repair.make_invoice']
+ self.RepairMakeInvoice = self.env['repair.order.make_invoice']
self.res_group_user = self.env.ref('stock.group_stock_user')
self.res_group_manager = self.env.ref('stock.group_stock_manager')
- self.mrp_repair_rmrp0 = self.env.ref('mrp_repair.mrp_repair_rmrp0')
- self.mrp_repair_rmrp1 = self.env.ref('mrp_repair.mrp_repair_rmrp1')
- self.mrp_repair_rmrp2 = self.env.ref('mrp_repair.mrp_repair_rmrp2')
+ self.repair_r0 = self.env.ref('repair.repair_r0')
+ self.repair_r1 = self.env.ref('repair.repair_r1')
+ self.repair_r2 = self.env.ref('repair.repair_r2')
- self.res_mrp_repair_user = self.ResUsers.create({
- 'name': 'MRP User',
+ self.res_repair_user = self.ResUsers.create({
+ 'name': 'Repair User',
'login': 'maru',
'password': 'maru',
- 'email': 'mrp_repair_user@yourcompany.com',
+ 'email': 'repair_user@yourcompany.com',
'groups_id': [(6, 0, [self.res_group_user.id])]})
- self.res_mrp_repair_manager = self.ResUsers.create({
- 'name': 'MRP Manager',
+ self.res_repair_manager = self.ResUsers.create({
+ 'name': 'Repair Manager',
'login': 'marm',
'password': 'marm',
- 'email': 'mrp_repair_manager@yourcompany.com',
+ 'email': 'repair_manager@yourcompany.com',
'groups_id': [(6, 0, [self.res_group_manager.id])]})
- def test_00_mrp_repair_afterinv(self):
+ def test_00_repair_afterinv(self):
# I confirm Repair order taking Invoice Method 'After Repair'.
- self.mrp_repair_rmrp0.sudo(self.res_mrp_repair_user.id).action_repair_confirm()
+ self.repair_r0.sudo(self.res_repair_user.id).action_repair_confirm()
# I check the state is in "Confirmed".
- self.assertEqual(self.mrp_repair_rmrp0.state, "confirmed", 'Mrp repair order should be in "Confirmed" state.')
- self.mrp_repair_rmrp0.action_repair_start()
+ self.assertEqual(self.repair_r0.state, "confirmed", 'Repair order should be in "Confirmed" state.')
+ self.repair_r0.action_repair_start()
# I check the state is in "Under Repair".
- self.assertEqual(self.mrp_repair_rmrp0.state, "under_repair", 'Mrp repair order should be in "Under_repair" state.')
+ self.assertEqual(self.repair_r0.state, "under_repair", 'Repair order should be in "Under_repair" state.')
# Repairing process for product is in Done state and I end Repair process by clicking on "End Repair" button.
- self.mrp_repair_rmrp0.action_repair_end()
+ self.repair_r0.action_repair_end()
# I define Invoice Method 'After Repair' option in this Repair order.so I create invoice by clicking on "Make Invoice" wizard.
- mrp_make_invoice = self.MrpRepairMakeInvoice.create({
+ make_invoice = self.RepairMakeInvoice.create({
'group': True})
# I click on "Create Invoice" button of this wizard to make invoice.
context = {
- "active_model": 'mrp_repair',
- "active_ids": [self.mrp_repair_rmrp0.id],
- "active_id": self.mrp_repair_rmrp0.id
+ "active_model": 'repair_order',
+ "active_ids": [self.repair_r0.id],
+ "active_id": self.repair_r0.id
}
- mrp_make_invoice.with_context(context).make_invoices()
+ make_invoice.with_context(context).make_invoices()
# I check that invoice is created for this Repair order.
- self.assertEqual(len(self.mrp_repair_rmrp0.invoice_id), 1, "No invoice exists for this repair order")
- self.assertEqual(len(self.mrp_repair_rmrp0.move_id.move_line_ids[0].consume_line_ids), 1, "Consume lines should be set")
+ self.assertEqual(len(self.repair_r0.invoice_id), 1, "No invoice exists for this repair order")
+ self.assertEqual(len(self.repair_r0.move_id.move_line_ids[0].consume_line_ids), 1, "Consume lines should be set")
- def test_01_mrp_repair_b4inv(self):
+ def test_01_epair_b4inv(self):
# I confirm Repair order for Invoice Method 'Before Repair'.
- self.mrp_repair_rmrp2.sudo(self.res_mrp_repair_user.id).action_repair_confirm()
+ self.repair_r2.sudo(self.res_repair_user.id).action_repair_confirm()
# I click on "Create Invoice" button of this wizard to make invoice.
- self.mrp_repair_rmrp2.action_repair_invoice_create()
+ self.repair_r2.action_repair_invoice_create()
# I check that invoice is created for this Repair order.
- self.assertEqual(len(self.mrp_repair_rmrp2.invoice_id), 1, "No invoice exists for this repair order")
+ self.assertEqual(len(self.repair_r2.invoice_id), 1, "No invoice exists for this repair order")
# I start the Repairing process by clicking on "Start Repair" button.
- self.mrp_repair_rmrp2.action_repair_start()
+ self.repair_r2.action_repair_start()
# Repairing process for this product is in Done state and I end this process by clicking on "End Repair" button for Invoice Method 'Before Repair'.
- self.mrp_repair_rmrp2.action_repair_end()
+ self.repair_r2.action_repair_end()
- def test_02_mrp_repair_noneinv(self):
+ def test_02_repair_noneinv(self):
# I confirm Repair order for Invoice Method 'No Invoice'.
- self.mrp_repair_rmrp1.sudo(self.res_mrp_repair_user.id).action_repair_confirm()
+ self.repair_r1.sudo(self.res_repair_user.id).action_repair_confirm()
# I start the repairing process by clicking on "Start Repair" button for Invoice Method 'No Invoice'.
- self.mrp_repair_rmrp1.action_repair_start()
+ self.repair_r1.action_repair_start()
# I check its state which is in "Under Repair".
- self.assertEqual(self.mrp_repair_rmrp1.state, "under_repair", 'Mrp repair order should be in "Under_repair" state.')
+ self.assertEqual(self.repair_r1.state, "under_repair", 'Repair order should be in "Under_repair" state.')
# Repairing process for product is in Done state and I end this process by clicking on "End Repair" button.
- self.mrp_repair_rmrp1.action_repair_end()
+ self.repair_r1.action_repair_end()
# I define Invoice Method 'No Invoice' option in this repair order.
# So, I check that Invoice has not been created for this repair order.
- self.assertNotEqual(len(self.mrp_repair_rmrp1.invoice_id), 1, "Invoice should not exist for this repair order")
+ self.assertNotEqual(len(self.repair_r1.invoice_id), 1, "Invoice should not exist for this repair order")
- def test_03_mrp_repair_fee(self):
- # I check the total amount of mrp_repair_rmrp1 is 100
- self.assertEqual(self.mrp_repair_rmrp1.amount_total, 100, "Amount_total should be 100")
+ def test_03_repair_fee(self):
+ # I check the total amount of repair_r1 is 100
+ self.assertEqual(self.repair_r1.amount_total, 100, "Amount_total should be 100")
# I add a new fee line
product_assembly = self.env.ref('product.product_product_5')
product_uom_hour = self.env.ref('product.product_uom_hour')
- self.MrpRepairFee = self.env['mrp.repair.fee']
+ self.RepairFee = self.env['repair.fee']
- self.MrpRepairFee.create({
+ self.RepairFee.create({
'name': 'PC Assemble + Custom (PC on Demand)',
'product_id': product_assembly.id,
'product_uom_qty': 1.0,
'product_uom': product_uom_hour.id,
'price_unit': 12.0,
- 'repair_id': self.mrp_repair_rmrp1.id})
- # I check the total amount of mrp_repair_rmrp1 is now 112
- self.assertEqual(self.mrp_repair_rmrp1.amount_total, 112, "Amount_total should be 100")
+ 'repair_id': self.repair_r1.id})
+ # I check the total amount of repair_r1 is now 112
+ self.assertEqual(self.repair_r1.amount_total, 112, "Amount_total should be 100")
diff --git a/addons/repair/views/repair_views.xml b/addons/repair/views/repair_views.xml
index 753e8287096..d70414b42e6 100644
--- a/addons/repair/views/repair_views.xml
+++ b/addons/repair/views/repair_views.xml
@@ -3,8 +3,8 @@
- mrp.repair.tree
- mrp.repair
+ repair.tree
+ repair.order
@@ -19,8 +19,8 @@
- mrp.repair.form
- mrp.repair
+ repair.form
+ repair.order
-
- mrp.repair.kanban
- mrp.repair
+
+ repair.kanban
+ repair.order
@@ -227,8 +227,8 @@
- mrp.repair.select
- mrp.repair
+ repair.select
+ repair.order
@@ -268,7 +268,7 @@
Repair Orders
ir.actions.act_window
- mrp.repair
+ repair.order
form
tree,kanban,form
@@ -288,7 +288,7 @@
+ web_icon="repair,static/description/icon.png"/>
diff --git a/addons/repair/wizard/__init__.py b/addons/repair/wizard/__init__.py
index 1d010fc9604..d28e5c48c47 100644
--- a/addons/repair/wizard/__init__.py
+++ b/addons/repair/wizard/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-from . import mrp_repair_cancel
-from . import mrp_repair_make_invoice
+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
index f9a0ef17a16..eceb6bcb97e 100644
--- a/addons/repair/wizard/repair_cancel.py
+++ b/addons/repair/wizard/repair_cancel.py
@@ -6,14 +6,14 @@ from odoo.exceptions import UserError
class RepairCancel(models.TransientModel):
- _name = 'mrp.repair.cancel'
+ _name = 'repair.cancel'
_description = 'Cancel Repair'
@api.multi
def cancel_repair(self):
if not self._context.get('active_id'):
return {'type': 'ir.actions.act_window_close'}
- repair = self.env['mrp.repair'].browse(self._context['active_id'])
+ repair = self.env['repair.order'].browse(self._context['active_id'])
if repair.invoiced or repair.invoice_method == 'none':
repair.action_cancel()
else:
@@ -24,10 +24,10 @@ class RepairCancel(models.TransientModel):
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') != 'mrp.repair':
+ if not repair_id or self._context.get('active_model') != 'repair.order':
return res
- repair = self.env['mrp.repair'].browse(repair_id)
+ repair = self.env['repair.order'].browse(repair_id)
if not repair.invoiced:
res['arch'] = """
diff --git a/addons/repair/wizard/stock_warn_insufficient_qty.py b/addons/repair/wizard/stock_warn_insufficient_qty.py
index 30e4f21a663..f5a1e3a4601 100644
--- a/addons/repair/wizard/stock_warn_insufficient_qty.py
+++ b/addons/repair/wizard/stock_warn_insufficient_qty.py
@@ -7,7 +7,7 @@ class StockWarnInsufficientQtyRepair(models.TransientModel):
_name = 'stock.warn.insufficient.qty.repair'
_inherit = 'stock.warn.insufficient.qty'
- repair_id = fields.Many2one('mrp.repair', string='Repair')
+ repair_id = fields.Many2one('repair.order', string='Repair')
def action_done(self):
self.ensure_one()
diff --git a/addons/stock/static/src/xml/stock_traceability_report_line.xml b/addons/stock/static/src/xml/stock_traceability_report_line.xml
index cd7d52a8abf..53c0fd5a111 100644
--- a/addons/stock/static/src/xml/stock_traceability_report_line.xml
+++ b/addons/stock/static/src/xml/stock_traceability_report_line.xml
@@ -42,7 +42,7 @@
-
+