Skip to content

Commit

Permalink
[IMP] repair: model name renamed to repair from mrp_repair and relate…
Browse files Browse the repository at this point in the history
…d changes in views
  • Loading branch information
hch-odoo authored and hsh-odoo committed Aug 17, 2017
1 parent 8b49007 commit 84fd246
Show file tree
Hide file tree
Showing 95 changed files with 205 additions and 205 deletions.
2 changes: 1 addition & 1 deletion addons/mrp/models/mrp_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MrpConfigSettings(models.TransientModel):
module_quality_mrp = fields.Boolean("Quality Control")
group_mrp_routings = fields.Boolean("Work Orders",
implied_group='mrp.group_mrp_routings')
module_mrp_repair = fields.Boolean("Repair")
module_repair = fields.Boolean("Repair")

@api.model
def get_values(self):
Expand Down
6 changes: 3 additions & 3 deletions addons/mrp/views/mrp_config_settings_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
</div>
</div>
</div>
<div class="col-md-6 col-xs-12 o_setting_box" id="mrp_repair">
<div class="col-md-6 col-xs-12 o_setting_box" id="repair">
<div class="o_setting_left_pane">
<field name="module_mrp_repair"/>
<field name="module_repair"/>
</div>
<div class="o_setting_right_pane">
<label for="module_mrp_repair"/>
<label for="module_repair"/>
<div class="text-muted">
Repair broken or damaged products
</div>
Expand Down
118 changes: 0 additions & 118 deletions addons/mrp_repair/tests/test_mrp_repair.py

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
'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',
'views/mrp_repair_views.xml',
'report/mrp_repair_reports.xml',
'report/mrp_repair_templates_repair_order.xml',
'security/repair_security.xml',
'wizard/repair_cancel_views.xml',
'wizard/repair_make_invoice_views.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.yml'],
'demo': ['data/repair_demo.yml'],
'test': [],
'installable': True,
'auto_install': False,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="seq_mrp_repair" model="ir.sequence">
<record id="seq_repair" model="ir.sequence">
<field name="name">Repair Order</field>
<field name="code">mrp.repair</field>
<field name="code">repair</field>
<field name="prefix">RMA</field>
<field name="padding">5</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<data noupdate="1">

<!--Email template -->
<record id="mail_template_mrp_repair_quotation" model="mail.template">
<field name="name">Mrp Repair Quotation - Send by Email</field>
<record id="mail_template_repair_quotation" model="mail.template">
<field name="name">Repair Quotation - Send by Email</field>
<field name="email_from">${(object.create_uid.email and '%s &lt;%s&gt;' % (object.create_uid.name, object.create_uid.email) or '')|safe}</field>
<field name="subject">${object.partner_id.name} Repair Orders (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="mrp_repair.model_mrp_repair"/>
<field name="report_template" ref="action_report_mrp_repair_order"/>
<field name="model_id" ref="repair.model_repair_order"/>
<field name="report_template" ref="action_report_repair_order"/>
<field name="report_name">${(object.name or '').replace('/','_')}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html" type="xml">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-
!record {model: mrp.repair, id: mrp_repair_rmrp1}:
!record {model: repair.order, id: repair_r1}:
address_id: base.res_partner_address_1
guarantee_limit: !eval datetime.today().strftime("%Y-%m-%d")
invoice_method: 'none'
Expand All @@ -26,7 +26,7 @@
price_unit: 50.0
partner_id: base.res_partner_12
-
!record {model: mrp.repair, id: mrp_repair_rmrp0}:
!record {model: repair.order, id: repair_r0}:
product_id: product.product_product_5
product_uom: product.product_uom_unit
address_id: base.res_partner_address_1
Expand All @@ -53,7 +53,7 @@
price_unit: 50.0
partner_id: base.res_partner_12
-
!record {model: mrp.repair, id: mrp_repair_rmrp2}:
!record {model: repair.order, id: repair_r2}:
product_id: product.product_product_6
product_uom: product.product_uom_unit
address_id: base.res_partner_address_1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from . import mrp_repair
from . import repair
from . import stock_traceability
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
class StockMove(models.Model):
_inherit = 'stock.move'

repair_id = fields.Many2one('mrp.repair')
repair_id = fields.Many2one('repair.order')


class Repair(models.Model):
_name = 'mrp.repair'
_name = 'repair.order'
_description = 'Repair Order'
_inherit = ['mail.thread', 'mail.activity.mixin']
_order = 'create_date desc'
Expand All @@ -29,7 +29,7 @@ def _default_stock_location(self):

name = fields.Char(
'Repair Reference',
default=lambda self: self.env['ir.sequence'].next_by_code('mrp.repair'),
default=lambda self: self.env['ir.sequence'].next_by_code('repair'),
copy=False, required=True,
states={'confirmed': [('readonly', True)]})
product_id = fields.Many2one(
Expand Down Expand Up @@ -82,7 +82,7 @@ def _default_stock_location(self):
help="Products repaired are all belonging to this lot", oldname="prodlot_id")
guarantee_limit = fields.Date('Warranty Expiration', states={'confirmed': [('readonly', True)]})
operations = fields.One2many(
'mrp.repair.line', 'repair_id', 'Parts',
'repair.line', 'repair_id', 'Parts',
copy=True, readonly=True, states={'draft': [('readonly', False)]})
pricelist_id = fields.Many2one(
'product.pricelist', 'Pricelist',
Expand All @@ -104,13 +104,13 @@ def _default_stock_location(self):
copy=False, readonly=True, track_visibility="onchange",
help="Move created by the repair order")
fees_lines = fields.One2many(
'mrp.repair.fee', 'repair_id', 'Operations',
'repair.fee', 'repair_id', 'Operations',
copy=True, readonly=True, states={'draft': [('readonly', False)]})
internal_notes = fields.Text('Internal Notes')
quotation_notes = fields.Text('Quotation Notes')
company_id = fields.Many2one(
'res.company', 'Company',
default=lambda self: self.env['res.company']._company_default_get('mrp.repair'))
default=lambda self: self.env['res.company']._company_default_get('repair'))
invoiced = fields.Boolean('Invoiced', copy=False, readonly=True)
repaired = fields.Boolean('Repaired', copy=False, readonly=True)
amount_untaxed = fields.Float('Untaxed Amount', compute='_amount_untaxed', store=True)
Expand Down Expand Up @@ -234,9 +234,9 @@ def action_repair_cancel(self):
@api.multi
def action_send_mail(self):
self.ensure_one()
template_id = self.env.ref('mrp_repair.mail_template_mrp_repair_quotation').id
template_id = self.env.ref('repair.mail_template_repair_quotation').id
ctx = {
'default_model': 'mrp.repair',
'default_model': 'repair.order',
'default_res_id': self.id,
'default_use_template': bool(template_id),
'default_template_id': template_id,
Expand All @@ -253,7 +253,7 @@ def action_send_mail(self):

@api.multi
def print_repair_order(self):
return self.env.ref('mrp_repair.action_report_mrp_repair_order').report_action(self)
return self.env.ref('repair.action_report_repair_order').report_action(self)

def action_repair_invoice_create(self):
for repair in self:
Expand Down Expand Up @@ -468,12 +468,12 @@ def action_repair_done(self):


class RepairLine(models.Model):
_name = 'mrp.repair.line'
_name = 'repair.line'
_description = 'Repair Line'

name = fields.Char('Description', required=True)
repair_id = fields.Many2one(
'mrp.repair', 'Repair Order Reference',
'repair.order', 'Repair Order Reference',
index=True, ondelete='cascade')
type = fields.Selection([
('add', 'Add'),
Expand Down Expand Up @@ -577,11 +577,11 @@ def onchange_product_id(self):


class RepairFee(models.Model):
_name = 'mrp.repair.fee'
_name = 'repair.fee'
_description = 'Repair Fees Line'

repair_id = fields.Many2one(
'mrp.repair', 'Repair Order Reference',
'repair.order', 'Repair Order Reference',
index=True, ondelete='cascade', required=True)
name = fields.Char('Description', index=True, required=True)
product_id = fields.Many2one('product.product', 'Product')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from odoo import models, api

class MrpStockReport(models.TransientModel):
class StockReport(models.TransientModel):
_inherit = 'stock.traceability.report'

@api.model
def get_links(self, move_line):
res_model, res_id, ref = super(MrpStockReport, self).get_links(move_line)
res_model, res_id, ref = super(StockReport, self).get_links(move_line)
if move_line.move_id.repair_id:
res_model = 'mrp.repair'
res_model = 'repair.order'
res_id = move_line.move_id.repair_id.id
ref = move_line.move_id.repair_id.name
return res_model, res_id, ref
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<data>
<report
string="Quotation / Order"
id="action_report_mrp_repair_order"
model="mrp.repair"
name="mrp_repair.report_mrprepairorder2"
file="mrp_repair.report_mrprepairorder"
id="action_report_repair_order"
model="repair.order"
name="repair.report_repairorder2"
file="repair.report_repairorder"
report_type="qweb-pdf"
print_report_name="(
object.state == 'draft' and 'Repair Quotation - %s' % (object.name) or
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_mrprepairorder">
<template id="report_repairorder">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<t t-set="o" t-value="o.with_context({'lang': o.partner_id.lang})" />
Expand Down Expand Up @@ -158,10 +158,10 @@
</t>
</template>

<template id="report_mrprepairorder2">
<template id="report_repairorder2">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="mrp_repair.report_mrprepairorder" t-lang="doc.partner_id.lang"/>
<t t-call="repair.report_repairorder" t-lang="doc.partner_id.lang"/>
</t>
</t>
</template>
Expand Down
Loading

0 comments on commit 84fd246

Please sign in to comment.