Skip to content

Commit

Permalink
[MIG] stock_request_direction: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed Apr 4, 2024
1 parent fc0a704 commit ebb52f7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
5 changes: 4 additions & 1 deletion stock_request_direction/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock Requests Direction
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:302f162b529a9ab3a8d9cebe13f3b56042c608dbb2d5aeed8af51305d92490fb
!! source digest: sha256:82fa2af82b3f4697cc02afc9e91a6553fdeeb25b54776fe9d0a66a481ff62a88
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -92,6 +92,9 @@ Contributors
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
* Kitti U. <kittiu@ecosoft.co.th>

* `[APSL](https://apsl.tech)`__:
* Antoni Marroig <amarroig@apsl.net>

Maintainers
~~~~~~~~~~~

Expand Down
4 changes: 2 additions & 2 deletions stock_request_direction/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Stock Requests Direction",
"summary": "From or to your warehouse?",
"version": "14.0.1.0.1",
"version": "16.0.1.0.0",
"license": "LGPL-3",
"website": "https://github.com/OCA/stock-logistics-request",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
Expand All @@ -18,4 +18,4 @@
"application": False,
"development_status": "Beta",
"maintainers": ["max3903"],
}
}
11 changes: 3 additions & 8 deletions stock_request_direction/models/stock_request_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class StockRequestOrder(models.Model):

direction = fields.Selection(
[("outbound", "Outbound"), ("inbound", "Inbound")],
string="Direction",
states={"draft": [("readonly", False)]},
readonly=True,
)
Expand All @@ -26,13 +25,9 @@ def _onchange_location_id(self):
if stock_request.route_id:
stock_request.route_id = False

@api.onchange("warehouse_id")
def onchange_warehouse_id(self):
# Onchange no longer needed
pass

def change_childs(self):
super().change_childs()
res = super().change_childs()
if not self._context.get("no_change_childs", False):
for line in self.stock_request_ids:
line.direction = self.direction
line.direction = self.direction
return res
3 changes: 3 additions & 0 deletions stock_request_direction/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@

* Pimolnat Suntian <pimolnats@ecosoft.co.th>
* Kitti U. <kittiu@ecosoft.co.th>

* `[APSL](https://apsl.tech)`__:
* Antoni Marroig <amarroig@apsl.net>
10 changes: 5 additions & 5 deletions stock_request_direction/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Stock Requests Direction</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:302f162b529a9ab3a8d9cebe13f3b56042c608dbb2d5aeed8af51305d92490fb
!! source digest: sha256:5486d41b67e4fe766f9eef1b7c89ecda25b219e7cd5780e3fb2a4a884d57075c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/stock-logistics-request/tree/16.0/stock_request_direction"><img alt="OCA/stock-logistics-request" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--request-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-request-16-0/stock-logistics-request-16-0-stock_request_direction"><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/stock-logistics-request&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<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/stock-logistics-warehouse/tree/14.0/stock_request_direction"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-14-0/stock-logistics-warehouse-14-0-stock_request_direction"><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/stock-logistics-warehouse&amp;target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module was written to allow users to request products to be transferred
from or to your warehouses. They can specify the direction and don’t have to
bother selecting the inventory location.</p>
Expand Down Expand Up @@ -413,10 +413,10 @@ <h2><a class="toc-backref" href="#toc-entry-3">Cancel</a></h2>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-request/issues">GitHub Issues</a>.
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-request/issues/new?body=module:%20stock_request_direction%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_request_direction%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand Down Expand Up @@ -452,7 +452,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/max3903"><img alt="max3903" src="https://github.com/max3903.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-request/tree/16.0/stock_request_direction">OCA/stock-logistics-request</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_request_direction">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions stock_request_direction/tests/test_stock_request_direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@


class TestStockRequestBase(TestStockRequest):
def setUp(self):
super(TestStockRequestBase, self).setUp()
@classmethod
def setUpClass(cls):
super(TestStockRequestBase, cls).setUpClass()

def test_onchange_direction_request(self):
# Outbound direction
Expand Down Expand Up @@ -116,10 +117,12 @@ def test_onchange_direction_order(self):
.create(vals)
)
self.assertEqual(order.location_id, self.warehouse.lot_stock_id)
order.stock_request_ids[:1].route_id = self.route
order.direction = "inbound"
order._onchange_location_id()
order.onchange_location_id()
self.assertEqual(
order.stock_request_ids[:1].location_id,
order.warehouse_id.lot_stock_id,
)
)
self.assertFalse(order.stock_request_ids[:1].route_id)

0 comments on commit ebb52f7

Please sign in to comment.