Skip to content

Commit 3e935d6

Browse files
committed
[MIG] mrp_subcontracting_partner_management: Migration to 16.0
TT47844
1 parent 867df57 commit 3e935d6

File tree

6 files changed

+65
-115
lines changed

6 files changed

+65
-115
lines changed

mrp_subcontracting_partner_management/README.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Subcontracting Partner Management
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:16e892122edafe36f84bd67e1692db60a22191ded7ce950e5d3295abf1ac13b4
10+
!! source digest: sha256:0ecea99a36dca318585a1dec84a643b80f6ed44b30ffb58cc1c25512c452df46
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Subcontracting Partner Management
1717
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
1818
:alt: License: LGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github
20-
:target: https://github.com/OCA/manufacture/tree/14.0/mrp_subcontracting_partner_management
20+
:target: https://github.com/OCA/manufacture/tree/16.0/mrp_subcontracting_partner_management
2121
:alt: OCA/manufacture
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_subcontracting_partner_management
23+
:target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_subcontracting_partner_management
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/manufacture&target_branch=14.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=16.0
2727
:alt: Try me on Runboat
2828

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

8686
Do not contact contributors directly about support or help with technical issues.
8787

@@ -113,6 +113,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
113113
mission is to support the collaborative development of Odoo features and
114114
promote its widespread use.
115115

116-
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/14.0/mrp_subcontracting_partner_management>`_ project on GitHub.
116+
This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/16.0/mrp_subcontracting_partner_management>`_ project on GitHub.
117117

118118
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
{
22
"name": "Subcontracting Partner Management",
3-
"version": "14.0.2.0.0",
3+
"version": "16.0.1.0.0",
44
"summary": "Subcontracting Partner Management",
55
"author": "Ooops404, Cetmix, Odoo Community Association (OCA)",
66
"license": "LGPL-3",
77
"category": "Inventory",
88
"website": "https://github.com/OCA/manufacture",
99
"depends": ["purchase_stock", "mrp_subcontracting", "sale_stock"],
10-
"external_dependencies": {},
11-
"demo": [],
1210
"data": [
1311
"views/res_partner_views.xml",
1412
"views/stock_picking_type_views.xml",
1513
],
16-
"qweb": [],
1714
"installable": True,
1815
"application": False,
1916
}

mrp_subcontracting_partner_management/models/res_partner.py

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,6 @@ def _set_subcontracting_values_active(self, active):
4444
for key in self.get_data_struct():
4545
self.mapped(key).write({"active": active})
4646

47-
@api.model
48-
def _update_name_translation(self, records, name):
49-
"""Update name field translation for records"""
50-
self.env["ir.translation"].search(
51-
[
52-
("name", "=", "{},name".format(records._name)),
53-
("res_id", "in", records.ids),
54-
("value", "!=", name),
55-
]
56-
).write({"value": name})
57-
5847
def _update_subcontractor_values_name(self, name):
5948
"""
6049
Update subcontractor related records:
@@ -69,17 +58,15 @@ def _update_subcontractor_values_name(self, name):
6958
for field in field_names:
7059
records = partners.mapped(field)
7160
records.write({"name": name})
72-
self._update_name_translation(records, name)
7361
type_name = "%s: IN" % name
7462
code = "".join(re.findall(r"\b\w", type_name))
7563
picks = partners.mapped("partner_picking_type_id")
7664
picks.write({"name": type_name, "sequence_code": code})
77-
self._update_name_translation(picks, type_name)
7865

7966
def unlink(self):
8067
"""This Method is override to archive all subcontracting field"""
8168
self._set_subcontracting_values_active(False)
82-
return super(ResPartner, self).unlink()
69+
return super().unlink()
8370

8471
def write(self, vals):
8572
if "is_subcontractor_partner" in vals:
@@ -88,7 +75,7 @@ def write(self, vals):
8875
)
8976
if "active" in vals:
9077
self._set_subcontracting_values_active(vals.get("active"))
91-
result = super(ResPartner, self).write(vals)
78+
result = super().write(vals)
9279
if vals.get("name"):
9380
self._update_subcontractor_values_name(vals.get("name"))
9481
return result
@@ -108,7 +95,7 @@ def create(self, vals_list):
10895
)(vals)
10996
or {}
11097
)
111-
return super(ResPartner, self).create(vals_list)
98+
return super().create(vals_list)
11299

113100
def _update_subcontractor_entities_for_record(self, is_subcontractor_partner):
114101
if not is_subcontractor_partner:
@@ -197,22 +184,20 @@ def _create_subcontracting_location_data(self, vals):
197184

198185
def _create_operation_type_for_subcontracting(self, vals):
199186
# Creating Operation Type for Subcontracting starts here
200-
operation_type_rec_id, _ = self._create_subcontracted_operation_type(vals)
201-
return {"partner_picking_type_id": operation_type_rec_id}
187+
pickint_type_id, _ = self._create_subcontracted_operation_type(vals)
188+
return {"partner_picking_type_id": pickint_type_id}
202189

203190
def _create_route_rule_for_subcontracting(self, vals):
204-
operation_type_rec_id, location_id = self._create_subcontracted_operation_type(
205-
vals
206-
)
191+
pickint_type_id, location_id = self._create_subcontracted_operation_type(vals)
207192
route = self.env.ref(
208193
"purchase_stock.route_warehouse0_buy", raise_if_not_found=False
209194
)
210195
buy_rule = self.env["stock.rule"].create(
211196
{
212197
"name": self._context.get("partner_name", self._compose_entity_name()),
213198
"action": "buy",
214-
"picking_type_id": operation_type_rec_id,
215-
"location_id": location_id,
199+
"picking_type_id": pickint_type_id,
200+
"location_dest_id": location_id,
216201
"route_id": route.id,
217202
}
218203
)
@@ -233,7 +218,7 @@ def _create_route_rule_for_subcontracting_resupply(self, vals):
233218
"action": "pull",
234219
"partner_address_id": self._origin.id,
235220
"picking_type_id": picking_type.id,
236-
"location_id": prop.id,
221+
"location_dest_id": prop.id,
237222
"location_src_id": self._get_location_id_for_record(vals),
238223
"route_id": route.id,
239224
"procure_method": "mts_else_mto",

mrp_subcontracting_partner_management/static/description/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ <h1 class="title">Subcontracting Partner Management</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:16e892122edafe36f84bd67e1692db60a22191ded7ce950e5d3295abf1ac13b4
370+
!! source digest: sha256:0ecea99a36dca318585a1dec84a643b80f6ed44b30ffb58cc1c25512c452df46
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/manufacture/tree/14.0/mrp_subcontracting_partner_management"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_subcontracting_partner_management"><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/manufacture&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/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/manufacture/tree/16.0/mrp_subcontracting_partner_management"><img alt="OCA/manufacture" src="https://img.shields.io/badge/github-OCA%2Fmanufacture-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_subcontracting_partner_management"><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/manufacture&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>The goal of this module is to simplify the management of the partner properties used in MRP Subcontracting.</p>
374374
<p>It adds a new checkbox “Subcontractor” which when enabled creates the following entities:</p>
375375
<ul class="simple">
@@ -434,7 +434,7 @@ <h1><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h1>
434434
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/manufacture/issues">GitHub Issues</a>.
435435
In case of trouble, please check there if your issue has already been reported.
436436
If you spotted it first, help us to smash it by providing a detailed and welcomed
437-
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_subcontracting_partner_management%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
437+
<a class="reference external" href="https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_subcontracting_partner_management%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
438438
<p>Do not contact contributors directly about support or help with technical issues.</p>
439439
</div>
440440
<div class="section" id="credits">
@@ -460,7 +460,7 @@ <h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
460460
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
461461
mission is to support the collaborative development of Odoo features and
462462
promote its widespread use.</p>
463-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/14.0/mrp_subcontracting_partner_management">OCA/manufacture</a> project on GitHub.</p>
463+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/manufacture/tree/16.0/mrp_subcontracting_partner_management">OCA/manufacture</a> project on GitHub.</p>
464464
<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>
465465
</div>
466466
</div>

0 commit comments

Comments
 (0)