Skip to content

Commit

Permalink
[MIG] stock_putaway_product_template: Migration to 13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
victoralmau committed Feb 11, 2021
1 parent cd4680d commit 4d99e34
Show file tree
Hide file tree
Showing 20 changed files with 124 additions and 410 deletions.
6 changes: 6 additions & 0 deletions setup/stock_putaway_product_template/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_putaway_product_template/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Putaway strategies on product form view
: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--warehouse-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_putaway_product_form
:target: https://github.com/OCA/stock-logistics-warehouse/tree/1.0/stock_putaway_product_template
:alt: OCA/stock-logistics-warehouse
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_putaway_product_form
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_putaway_product_template
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/153/12.0
:target: https://runbot.odoo-community.org/runbot/153/1.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -45,7 +45,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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-warehouse/issues/new?body=module:%20stock_putaway_product_form%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_putaway_product_template%0Aversion:%2013.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 @@ -92,6 +92,6 @@ Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-kevinkhao| |maintainer-sebastienbeau|

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_putaway_product_form>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_putaway_product_template>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 0 additions & 2 deletions stock_putaway_product_template/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import tests
from .hooks import post_init_hook
11 changes: 4 additions & 7 deletions stock_putaway_product_template/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Putaway strategies on product form view",
"summary": "Edit putaway strategies directly from the product form view",
"version": "12.0.1.0.0",
"name": "Product template in putaway strategies",
"summary": "Add product template in putaway strategies from the product view",
"version": "13.0.1.0.0",
"category": "Inventory",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Akretion, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": ["stock"],
"external_dependencies": {"python": ["openupgradelib"]},
"data": ["views/product.xml"],
"demo": ["demo/putaway_strategies.xml"],
"data": ["views/stock_putaway_rule_views.xml"],
"maintainers": ["kevinkhao", "sebastienbeau"],
"post_init_hook": "post_init_hook",
}
31 changes: 0 additions & 31 deletions stock_putaway_product_template/demo/putaway_strategies.xml

This file was deleted.

21 changes: 0 additions & 21 deletions stock_putaway_product_template/hooks.py

This file was deleted.

88 changes: 0 additions & 88 deletions stock_putaway_product_template/i18n/stock_putaway_product_form.pot

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_putaway_product_template
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-10 15:21+0000\n"
"PO-Revision-Date: 2021-02-10 15:21+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: stock_putaway_product_template
#: model:ir.model.fields,field_description:stock_putaway_product_template.field_stock_putaway_rule__product_tmpl_id
msgid "Product Tmpl"
msgstr ""

#. module: stock_putaway_product_template
#: model:ir.model,name:stock_putaway_product_template.model_stock_putaway_rule
msgid "Putaway Rule"
msgstr ""
4 changes: 1 addition & 3 deletions stock_putaway_product_template/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from . import product_product
from . import product_template
from . import putaway_strategy
from . import stock_putaway_rule
13 changes: 0 additions & 13 deletions stock_putaway_product_template/models/product_product.py

This file was deleted.

58 changes: 0 additions & 58 deletions stock_putaway_product_template/models/product_template.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# Copyright 2020 Sergio Teruel - Tecnativa <sergio.teruel@tecnativa.com>
# Copyright 2020 Sergio Teruel - Tecnativa
# Copyright 2020 Víctor Martínez - Tecnativa

from odoo import api, fields, models


class PutAwayStrategy(models.Model):
_inherit = "product.putaway"

# Remove product domain to allow to select product templates
product_location_ids = fields.One2many(domain=[])

def _get_putaway_rule(self, product):
return super(
PutAwayStrategy, self.with_context(filter_putaway_rule=True)
)._get_putaway_rule(product)


class FixedPutAwayStrategy(models.Model):
_inherit = "stock.fixed.putaway.strat"
class StockPutawayRule(models.Model):
_inherit = "stock.putaway.rule"

product_tmpl_id = fields.Many2one(
comodel_name="product.template",
compute="_compute_product_tmpl_id",
store=True,
inverse=lambda self: self,
readonly=False,
ondelete="cascade",
)

@api.depends("product_id")
def _compute_product_tmpl_id(self):
for rec in self:
rec.product_tmpl_id = False
if rec.product_id:
rec.product_tmpl_id = rec.product_id.product_tmpl_id
else:
Expand All @@ -38,7 +28,7 @@ def _compute_product_tmpl_id(self):
rec.product_tmpl_id = params.get("id", False)

def filtered(self, func):
res = super(FixedPutAwayStrategy, self).filtered(func)
res = super(StockPutawayRule, self).filtered(func)
if res or not self.env.context.get("filter_putaway_rule"):
return res
product = func.__closure__[0].cell_contents
Expand Down
1 change: 1 addition & 0 deletions stock_putaway_product_template/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
* `Tecnativa <https://www.tecnativa.com>`_:

* Sergio Teruel
* Víctor Martínez
2 changes: 1 addition & 1 deletion stock_putaway_product_template/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This module adds an easy way to modify product-specific putaway strategies from the product view for a better UX.
This module add product template in putaway strategies from the product view to not need defined putaway strategies for all variants.
5 changes: 3 additions & 2 deletions stock_putaway_product_template/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* In Settings, set "Storage Locations" to True
* In Inventory Settings, set "Storage Locations" to True
* User should be in "Manage push and pull inventory flows"
* Open the form view of a product template or a product and use the fields located under the "Inventory" tab
* Inside a product go to "Putaway rules"
* It's possible to define record to template

0 comments on commit 4d99e34

Please sign in to comment.