Skip to content

Commit

Permalink
[MIG] stock_picking_product_availability_inline: Migration to v15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-teruel committed Nov 8, 2022
1 parent 40aea8c commit 89e72dc
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 36 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_product_availability_inline/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
10 changes: 5 additions & 5 deletions stock_picking_product_availability_inline/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Stock Picking Product Availability Inline
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_picking_product_availability_inline
:target: https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_product_availability_inline
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-13-0/stock-logistics-workflow-13-0-stock_picking_product_availability_inline
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_product_availability_inline
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/154/13.0
:target: https://runbot.odoo-community.org/runbot/154/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -51,7 +51,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_product_availability_inline%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_product_availability_inline%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Expand Down Expand Up @@ -84,6 +84,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_picking_product_availability_inline>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_product_availability_inline>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 2 additions & 2 deletions stock_picking_product_availability_inline/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{
"name": "Stock Picking Product Availability Inline",
"summary": "Show product availability in product drop-down in stock picking form view.",
"version": "13.0.1.1.1",
"version": "15.0.1.0.0",
"development_status": "Beta",
"category": "Warehouse Management",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["stock", "base_view_inheritance_extension"],
"depends": ["stock"],
"data": ["views/stock_picking_views.xml", "views/stock_move_line_views.xml"],
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class StockMove(models.Model):
_inherit = "stock.move"

@api.onchange("product_id")
def onchange_product_id(self):
def _onchange_product_id(self):
"""Avoid calling product name_get method several times
with 'sp_product_stock_inline' context key.
"""
Expand All @@ -27,7 +27,7 @@ def onchange_product_id(self):
sp_line = self.with_context(
sp_product_stock_inline=False, warehouse=self.warehouse_id.id
)
return super(StockMove, sp_line).onchange_product_id()
return super(StockMove, sp_line)._onchange_product_id()


class StockMoveLine(models.Model):
Expand All @@ -40,7 +40,7 @@ class StockMoveLine(models.Model):
)

@api.onchange("product_id")
def onchange_product_id(self):
def _onchange_product_id(self):
"""Avoid calling product name_get method several times
with 'sp_product_stock_inline' context key.
"""
Expand All @@ -50,4 +50,4 @@ def onchange_product_id(self):
sp_product_stock_inline=False,
warehouse=self.picking_type_warehouse_id.id,
)
return super(StockMoveLine, sp_line).onchange_product_id()
return super(StockMoveLine, sp_line)._onchange_product_id()
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Stock Picking Product Availability Inline</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_picking_product_availability_inline"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-13-0/stock-logistics-workflow-13-0-stock_picking_product_availability_inline"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/154/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_product_availability_inline"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_picking_product_availability_inline"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/154/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of ‘Warehouse Management’
to show you the stock availability (Free To Use Quantity) of each product
as part of its name in the product drop-down widget on stock picking.</p>
Expand Down Expand Up @@ -400,7 +400,7 @@ <h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_product_availability_inline%0Aversion:%2013.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-workflow/issues/new?body=module:%20stock_picking_product_availability_inline%0Aversion:%2015.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 @@ -428,7 +428,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_picking_product_availability_inline">OCA/stock-logistics-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_picking_product_availability_inline">OCA/stock-logistics-workflow</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
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright 2022 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.tests import Form, SavepointCase, tagged
from odoo.tests import Form, TransactionCase, tagged


@tagged("post_install", "-at_install")
class TestStockPickingProductAvailabilityInline(SavepointCase):
class TestStockPickingProductAvailabilityInline(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
<field name="picking_type_warehouse_id" invisible="1" />
</xpath>
<xpath expr="//field[@name='product_id']" position="attributes">
<attribute
name="context"
operation="python_dict"
key="sp_product_stock_inline"
>True</attribute>
<attribute
name="context"
operation="python_dict"
key="warehouse"
>picking_type_warehouse_id</attribute>
<attribute name="context" operation="update">
{
"sp_product_stock_inline": True,
"warehouse": picking_type_warehouse_id
}
</attribute>
</xpath>
</field>
</record>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
expr="//field[@name='move_ids_without_package']/tree/field[@name='product_id']"
position="attributes"
>
<attribute
name="context"
operation="python_dict"
key="sp_product_stock_inline"
>True</attribute>
<attribute
name="context"
operation="python_dict"
key="warehouse"
>parent.picking_type_warehouse_id</attribute>
<attribute name="context" operation="update">
{
"sp_product_stock_inline": True,
"warehouse": parent.picking_type_warehouse_id
}
</attribute>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 89e72dc

Please sign in to comment.