Skip to content

Commit

Permalink
[14.0][Fix]maintenance_checklist: Fix conflict with base_maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
mmrondon committed Oct 11, 2024
1 parent d969549 commit f7a4e9a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 81 deletions.
2 changes: 1 addition & 1 deletion maintenance_checklist/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"website": "https://github.com/OCA/maintenance",
"summary": "Checklist Maintenance",
"license": "AGPL-3",
"depends": ["base", "maintenance"],
"depends": ["base_maintenance"],
"data": [
"security/ir.model.access.csv",
"views/report_maintenance_view.xml",
Expand Down
14 changes: 2 additions & 12 deletions maintenance_checklist/views/maintenance_checklist_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
<record id="maintenance_request_view_form_inherit_checklist" model="ir.ui.view">
<field name="name">maintenance.request.view.form.inherit.checklist</field>
<field name="model">maintenance.request</field>
<field name="inherit_id" ref="maintenance.hr_equipment_request_view_form" />
<field name="inherit_id" ref="base_maintenance.equipment_request_view_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='description']" position="before">
<xpath expr="//notebook" position="before">
<group col="6">
<field
name="total_checklist"
Expand Down Expand Up @@ -165,14 +165,4 @@
</field>
</record>

<report
id="report_maintenance_request_id"
model="maintenance.request"
string="Maintenance Request"
report_type="qweb-pdf"
name="maintenance_checklist.report_maintenance_request"
file="maintenance_checklist.report_maintenance_request"
print_report_name="'Maintenance - %s' % (object.equipment_id.name)"
/>

</odoo>
91 changes: 23 additions & 68 deletions maintenance_checklist/views/report_maintenance_view.xml
Original file line number Diff line number Diff line change
@@ -1,73 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="report_maintenance_request">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
<div class="page">
<h2>Maintenance Request</h2>
<p t-field="o.name" />
<table class="table table-sm table-bordered">
<tr>
<td><strong>Name</strong></td>
<td><span t-field="o.name" /></td>
<td><strong>Equipment</strong></td>
<td><span t-field="o.equipment_id.name" /></td>
</tr>
<tr>
<td><strong>Category</strong></td>
<td><span t-field="o.category_id.name" /></td>
<td><strong>Request Date</strong></td>
<td><span t-field="o.request_date" /></td>
</tr>
<tr>
<td><strong>Maintenance Type</strong></td>
<td><span t-field="o.maintenance_type" /></td>
<td><strong>Maintenance Team</strong></td>
<td><span t-field="o.maintenance_team_id.name" /></td>
</tr>
<tr>
<td><strong>Responsible</strong></td>
<td><span t-field="o.user_id.partner_id.name" /></td>
<td><strong>Scheduled Date</strong></td>
<td><span t-field="o.schedule_date" /></td>
</tr>
<tr>
<td><strong>Duration</strong></td>
<td><span
t-field="o.duration"
t-options='{"widget": "float_time"}'
/></td>
<td><strong>Priority</strong></td>
<td><span t-field="o.priority" /></td>
</tr>
</table>

<table class="table table-sm">
<thead>
<tr>
<th>Checklist</th>
<th>Name</th>
<th>Description</th>
<th>State</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.checklist_ids" t-as="line">
<td><span t-field="line.checklist_id.name" /></td>
<td><span t-field="line.name" /></td>
<td><span t-field="line.description_checklist" /></td>
<td><span
t-field="line.state"
t-options="{'classes': {'new': 'default', 'done': 'success','process': 'default', 'block': 'danger'}}"
/></td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</t>
<template id="report_maintenance_request_document" inherit_id="base_maintenance.report_maintenance_request_document">
<xpath expr="//div[@id='description']" position="before">
<table class="table table-sm">
<thead>
<tr>
<th>Checklist</th>
<th>Name</th>
<th>Description</th>
<th>State</th>
</tr>
</thead>
<tbody>
<tr t-foreach="doc.checklist_ids" t-as="line">
<td><span t-field="line.checklist_id.name"/></td>
<td><span t-field="line.name" /></td>
<td><span t-field="line.description_checklist"/></td>
<td><span t-field="line.state"
t-options="{'classes': {'new': 'default', 'done': 'success','process': 'default', 'block': 'danger'}}"/>
</td>
</tr>
</tbody>
</table>
</xpath>
</template>

</odoo>

0 comments on commit f7a4e9a

Please sign in to comment.