Skip to content

Commit

Permalink
[MIG] product_route_profile: migrate to V16
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Nov 15, 2024
1 parent 05c3784 commit 94b43a8
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 54 deletions.
36 changes: 18 additions & 18 deletions product_route_profile/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ Product Route Profile
: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/17.0/product_route_profile
:target: https://github.com/OCA/stock-logistics-warehouse/tree/16.0/product_route_profile
: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-17-0/stock-logistics-warehouse-17-0-product_route_profile
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-16-0/stock-logistics-warehouse-16-0-product_route_profile
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=17.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-warehouse&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module replaces the initial concept of route_ids with a new concept
of "route profile", coming with a company-specific and priority route
profile.
This module replaces the initial concept of route_ids with a new concept of "route profile", coming with a company-specific and priority route profile.

**Table of contents**

Expand All @@ -40,13 +38,15 @@ profile.
Usage
=====

**Route profile** In Inventory > Configuration > Settings > Routes
Profiles - Create some Route profile depending on your needs
**Route profile**
In Inventory > Configuration > Settings > Routes Profiles
- Create some Route profile depending on your needs

**On product** On each template product, in inventory page, we can
select: - **Route Profile**: a default profile, common to all companies
- **Priority Route Profile**: a profile specific to each company and
priority if existing.

**On product**
On each template product, in inventory page, we can select:
- **Route Profile**: a default profile, common to all companies
- **Priority Route Profile**: a profile specific to each company and priority if existing.

Known issues / Roadmap
======================
Expand All @@ -59,25 +59,25 @@ 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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20product_route_profile%0Aversion:%2017.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:%20product_route_profile%0Aversion:%2016.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.

Credits
=======

Authors
-------
~~~~~~~

* Akretion

Contributors
------------
~~~~~~~~~~~~

- Kévin Roche <[email protected]>
* Kévin Roche <[email protected]>

Maintainers
-----------
~~~~~~~~~~~

This module is maintained by the OCA.

Expand All @@ -97,6 +97,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Kev-Roche|

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/17.0/product_route_profile>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/16.0/product_route_profile>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion product_route_profile/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Product Route Profile",
"summary": "Add Route profile concept on product",
"version": "17.0.1.0.0",
"version": "16.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Akretion, Odoo Community Association (OCA)",
Expand Down
9 changes: 6 additions & 3 deletions product_route_profile/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@

from collections import defaultdict

from odoo import SUPERUSER_ID, api

def post_init_hook(env):

def post_init_hook(cr, registry):
def get_profile(route_ids):
route_ids = tuple(set(route_ids))
profile = route2profile.get(route_ids)
Expand All @@ -22,12 +24,13 @@ def get_profile(route_ids):
route2profile[route_ids] = profile
return profile

env = api.Environment(cr, SUPERUSER_ID, {})
query = """
SELECT product_id, array_agg(route_id)
FROM stock_route_product group by product_id;
"""
env.cr.execute(query)
results = env.cr.fetchall()
cr.execute(query)
results = cr.fetchall()
route2profile = {}
profile2product = defaultdict(lambda: env["product.template"])
for row in results:
Expand Down
3 changes: 0 additions & 3 deletions product_route_profile/pyproject.toml

This file was deleted.

1 change: 0 additions & 1 deletion product_route_profile/readme/CONTRIBUTORS.md

This file was deleted.

1 change: 1 addition & 0 deletions product_route_profile/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Kévin Roche <[email protected]>
File renamed without changes.
File renamed without changes.
7 changes: 0 additions & 7 deletions product_route_profile/readme/USAGE.md

This file was deleted.

9 changes: 9 additions & 0 deletions product_route_profile/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
**Route profile**
In Inventory > Configuration > Settings > Routes Profiles
- Create some Route profile depending on your needs


**On product**
On each template product, in inventory page, we can select:
- **Route Profile**: a default profile, common to all companies
- **Priority Route Profile**: a profile specific to each company and priority if existing.
34 changes: 15 additions & 19 deletions product_route_profile/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

/*
:Author: David Goodger ([email protected])
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
Expand Down Expand Up @@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }

pre.code .ln { color: gray; } /* line numbers */
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
Expand All @@ -301,7 +300,7 @@
span.pre {
white-space: pre }

span.problematic, pre.problematic {
span.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -369,10 +368,8 @@ <h1 class="title">Product Route Profile</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7cc88b31d2c501945a5fd15642253db4a45a0e955d04d5a2ba9d2ad131a9155d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/stock-logistics-warehouse/tree/17.0/product_route_profile"><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-17-0/stock-logistics-warehouse-17-0-product_route_profile"><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=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module replaces the initial concept of route_ids with a new concept
of “route profile”, coming with a company-specific and priority route
profile.</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/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/stock-logistics-warehouse/tree/16.0/product_route_profile"><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-16-0/stock-logistics-warehouse-16-0-product_route_profile"><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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module replaces the initial concept of route_ids with a new concept of “route profile”, coming with a company-specific and priority route profile.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -389,12 +386,13 @@ <h1 class="title">Product Route Profile</h1>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p><strong>Route profile</strong> In Inventory &gt; Configuration &gt; Settings &gt; Routes
Profiles - Create some Route profile depending on your needs</p>
<p><strong>On product</strong> On each template product, in inventory page, we can
select: - <strong>Route Profile</strong>: a default profile, common to all companies
- <strong>Priority Route Profile</strong>: a profile specific to each company and
priority if existing.</p>
<p><strong>Route profile</strong>
In Inventory &gt; Configuration &gt; Settings &gt; Routes Profiles
- Create some Route profile depending on your needs</p>
<p><strong>On product</strong>
On each template product, in inventory page, we can select:
- <strong>Route Profile</strong>: a default profile, common to all companies
- <strong>Priority Route Profile</strong>: a profile specific to each company and priority if existing.</p>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
Expand All @@ -405,7 +403,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<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-warehouse/issues/new?body=module:%20product_route_profile%0Aversion:%2017.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:%20product_route_profile%0Aversion:%2016.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 All @@ -425,15 +423,13 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<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>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/Kev-Roche"><img alt="Kev-Roche" src="https://github.com/Kev-Roche.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/17.0/product_route_profile">OCA/stock-logistics-warehouse</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/16.0/product_route_profile">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
4 changes: 2 additions & 2 deletions product_route_profile/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
<xpath expr="//group[@name='operations']" position="inside">
<field
name="route_profile_id"
invisible="type not in ['product', 'consu']"
attrs="{'invisible': [('type', 'not in', ['product', 'consu'])], 'required': [('type', 'in', ['product', 'consu'])]}"
/>
<field
name="force_route_profile_id"
invisible="type not in ['product', 'consu']"
attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}"
/>
</xpath>
</field>
Expand Down
6 changes: 6 additions & 0 deletions setup/product_route_profile/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,
)

0 comments on commit 94b43a8

Please sign in to comment.