[MIG] product_route_profile: migrate to V16

This commit is contained in:
andrea
2024-11-15 15:34:09 +01:00
parent 05c3784e35
commit 94b43a86d2
14 changed files with 59 additions and 54 deletions

View File

@@ -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**
@@ -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
======================
@@ -59,7 +59,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 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.
@@ -67,17 +67,17 @@ Credits
=======
Authors
-------
~~~~~~~
* Akretion
Contributors
------------
~~~~~~~~~~~~
- Kévin Roche <kevin.roche@akretion.com>
* Kévin Roche <kevin.roche@akretion.com>
Maintainers
-----------
~~~~~~~~~~~
This module is maintained by the OCA.
@@ -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.

View File

@@ -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)",

View File

@@ -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)
@@ -22,12 +24,13 @@ def post_init_hook(env):
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:

View File

@@ -1,3 +0,0 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"

View File

@@ -1 +0,0 @@
- Kévin Roche \<<kevin.roche@akretion.com>\>

View File

@@ -0,0 +1 @@
* Kévin Roche <kevin.roche@akretion.com>

View File

@@ -1,7 +0,0 @@
**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.

View File

@@ -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.

View File

@@ -8,11 +8,10 @@
/*
:Author: David Goodger (goodger@python.org)
: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.
@@ -275,7 +274,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
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 }
@@ -301,7 +300,7 @@ span.option {
span.pre {
white-space: pre }
span.problematic, pre.problematic {
span.problematic {
color: red }
span.section-subtitle {
@@ -369,10 +368,8 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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">
@@ -389,12 +386,13 @@ profile.</p>
</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>
@@ -405,7 +403,7 @@ priority if existing.</p>
<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">
@@ -425,15 +423,13 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<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>

View File

@@ -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>

View File

@@ -0,0 +1 @@
../../../../product_route_profile

View File

@@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)