Skip to content

Commit 7d59e71

Browse files
author
Laurent Stukkens
committed
[MIG] maintenance_location: Migration to 16.0
1 parent d926ef7 commit 7d59e71

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

maintenance_location/README.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Maintenance Location
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:4bbadc3f945366acbd515935feaf10cdb5bb59efbfb63117a8fa5d17268cda05
10+
!! source digest: sha256:5143b2a600e8f73c5247e22c749cce44d1092909b5ded3d7af91d2d797f81924
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Maintenance Location
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github
20-
:target: https://github.com/OCA/maintenance/tree/14.0/maintenance_location
20+
:target: https://github.com/OCA/maintenance/tree/16.0/maintenance_location
2121
:alt: OCA/maintenance
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_location
23+
:target: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_location
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=14.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/maintenance&target_branch=16.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -41,7 +41,7 @@ Bug Tracker
4141
Bugs are tracked on `GitHub Issues <https://github.com/OCA/maintenance/issues>`_.
4242
In case of trouble, please check there if your issue has already been reported.
4343
If you spotted it first, help us to smash it by providing a detailed and welcomed
44-
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_location%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
44+
`feedback <https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_location%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
4545

4646
Do not contact contributors directly about support or help with technical issues.
4747

@@ -74,6 +74,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
7474
mission is to support the collaborative development of Odoo features and
7575
promote its widespread use.
7676

77-
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/14.0/maintenance_location>`_ project on GitHub.
77+
This module is part of the `OCA/maintenance <https://github.com/OCA/maintenance/tree/16.0/maintenance_location>`_ project on GitHub.
7878

7979
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

maintenance_location/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"name": "Maintenance Location",
66
"summary": """
77
Define a location system for maintenance""",
8-
"version": "14.0.1.0.0",
8+
"version": "16.0.1.0.0",
99
"license": "AGPL-3",
1010
"author": "CreuBlanca,Odoo Community Association (OCA)",
1111
"website": "https://github.com/OCA/maintenance",

maintenance_location/models/maintenance_location.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ class MaintenanceLocation(models.Model):
1717

1818
name = fields.Char(required=True)
1919
description = fields.Char()
20-
complete_name = fields.Char(compute="_compute_complete_name", store=True)
20+
complete_name = fields.Char(
21+
compute="_compute_complete_name", store=True, recursive=True
22+
)
2123

2224
partner_id = fields.Many2one("res.partner")
2325

@@ -28,7 +30,7 @@ class MaintenanceLocation(models.Model):
2830
ondelete="cascade",
2931
)
3032
child_id = fields.One2many("maintenance.location", "parent_id", "Child Locations")
31-
parent_path = fields.Char(index=True)
33+
parent_path = fields.Char(index=True, unaccent=False)
3234
latitude = fields.Float(digits=(16, 5))
3335
longitude = fields.Float(digits=(16, 5))
3436
sequence = fields.Integer(default=10)

maintenance_location/models/maintenance_request.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@ class MaintenanceRequest(models.Model):
88

99
_inherit = "maintenance.request"
1010

11-
location_id = fields.Many2one("maintenance.location")
11+
location_id = fields.Many2one(
12+
"maintenance.location",
13+
compute="_compute_equipment_id",
14+
store=True,
15+
readonly=False,
16+
)
1217

13-
@api.onchange("equipment_id")
14-
def _onchange_equipment_id(self):
18+
@api.depends("equipment_id")
19+
def _compute_equipment_id(self):
1520
for record in self:
1621
if record.equipment_id and record.equipment_id.location_id:
1722
record.location_id = record.equipment_id.location_id

maintenance_location/static/description/index.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
12
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
23
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
34
<head>
@@ -366,9 +367,9 @@ <h1 class="title">Maintenance Location</h1>
366367
!! This file is generated by oca-gen-addon-readme !!
367368
!! changes will be overwritten. !!
368369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
369-
!! source digest: sha256:4bbadc3f945366acbd515935feaf10cdb5bb59efbfb63117a8fa5d17268cda05
370+
!! source digest: sha256:5143b2a600e8f73c5247e22c749cce44d1092909b5ded3d7af91d2d797f81924
370371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
371-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/maintenance/tree/14.0/maintenance_location"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/maintenance-14-0/maintenance-14-0-maintenance_location"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/maintenance&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/maintenance/tree/16.0/maintenance_location"><img alt="OCA/maintenance" src="https://img.shields.io/badge/github-OCA%2Fmaintenance-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_location"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/maintenance&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372373
<p>Define a location system with hierarchy for maintenance equipments and requests.</p>
373374
<p><strong>Table of contents</strong></p>
374375
<div class="contents local topic" id="contents">
@@ -387,7 +388,7 @@ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
387388
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/maintenance/issues">GitHub Issues</a>.
388389
In case of trouble, please check there if your issue has already been reported.
389390
If you spotted it first, help us to smash it by providing a detailed and welcomed
390-
<a class="reference external" href="https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_location%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
391+
<a class="reference external" href="https://github.com/OCA/maintenance/issues/new?body=module:%20maintenance_location%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
391392
<p>Do not contact contributors directly about support or help with technical issues.</p>
392393
</div>
393394
<div class="section" id="credits">
@@ -414,7 +415,7 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
414415
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
415416
mission is to support the collaborative development of Odoo features and
416417
promote its widespread use.</p>
417-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/14.0/maintenance_location">OCA/maintenance</a> project on GitHub.</p>
418+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/maintenance/tree/16.0/maintenance_location">OCA/maintenance</a> project on GitHub.</p>
418419
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
419420
</div>
420421
</div>

maintenance_location/tests/test_maintenance_location.py

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def test_maintenance_location(self):
4444
self.location_1.write({"parent_id": self.location_2.id})
4545

4646
self.request.write({"equipment_id": self.equipment.id})
47-
self.request._onchange_equipment_id()
4847
self.assertEqual(self.request.location_id.id, self.location_1.id)
4948

5049
def test_request_creation(self):

0 commit comments

Comments
 (0)