mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[MIG] product_route_profile: migrate to V16
This commit is contained in:
@@ -17,20 +17,18 @@ Product Route Profile
|
|||||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
:alt: License: AGPL-3
|
:alt: License: AGPL-3
|
||||||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github
|
.. |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
|
:alt: OCA/stock-logistics-warehouse
|
||||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
.. |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
|
:alt: Translate me on Weblate
|
||||||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
|
.. |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
|
:alt: Try me on Runboat
|
||||||
|
|
||||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||||
|
|
||||||
This module replaces the initial concept of route_ids with a new concept
|
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.
|
||||||
of "route profile", coming with a company-specific and priority route
|
|
||||||
profile.
|
|
||||||
|
|
||||||
**Table of contents**
|
**Table of contents**
|
||||||
|
|
||||||
@@ -40,13 +38,15 @@ profile.
|
|||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
**Route profile** In Inventory > Configuration > Settings > Routes
|
**Route profile**
|
||||||
Profiles - Create some Route profile depending on your needs
|
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
|
**On product**
|
||||||
- **Priority Route Profile**: a profile specific to each company and
|
On each template product, in inventory page, we can select:
|
||||||
priority if existing.
|
- **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
|
Known issues / Roadmap
|
||||||
======================
|
======================
|
||||||
@@ -59,7 +59,7 @@ Bug Tracker
|
|||||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/issues>`_.
|
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.
|
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
|
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.
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
@@ -67,17 +67,17 @@ Credits
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
-------
|
~~~~~~~
|
||||||
|
|
||||||
* Akretion
|
* Akretion
|
||||||
|
|
||||||
Contributors
|
Contributors
|
||||||
------------
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
- Kévin Roche <kevin.roche@akretion.com>
|
* Kévin Roche <kevin.roche@akretion.com>
|
||||||
|
|
||||||
Maintainers
|
Maintainers
|
||||||
-----------
|
~~~~~~~~~~~
|
||||||
|
|
||||||
This module is maintained by the OCA.
|
This module is maintained by the OCA.
|
||||||
|
|
||||||
@@ -97,6 +97,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|
|||||||
|
|
||||||
|maintainer-Kev-Roche|
|
|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.
|
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Product Route Profile",
|
"name": "Product Route Profile",
|
||||||
"summary": "Add Route profile concept on product",
|
"summary": "Add Route profile concept on product",
|
||||||
"version": "17.0.1.0.0",
|
"version": "16.0.1.0.0",
|
||||||
"category": "Warehouse",
|
"category": "Warehouse",
|
||||||
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
"website": "https://github.com/OCA/stock-logistics-warehouse",
|
||||||
"author": "Akretion, Odoo Community Association (OCA)",
|
"author": "Akretion, Odoo Community Association (OCA)",
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
from collections import defaultdict
|
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):
|
def get_profile(route_ids):
|
||||||
route_ids = tuple(set(route_ids))
|
route_ids = tuple(set(route_ids))
|
||||||
profile = route2profile.get(route_ids)
|
profile = route2profile.get(route_ids)
|
||||||
@@ -22,12 +24,13 @@ def post_init_hook(env):
|
|||||||
route2profile[route_ids] = profile
|
route2profile[route_ids] = profile
|
||||||
return profile
|
return profile
|
||||||
|
|
||||||
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||||
query = """
|
query = """
|
||||||
SELECT product_id, array_agg(route_id)
|
SELECT product_id, array_agg(route_id)
|
||||||
FROM stock_route_product group by product_id;
|
FROM stock_route_product group by product_id;
|
||||||
"""
|
"""
|
||||||
env.cr.execute(query)
|
cr.execute(query)
|
||||||
results = env.cr.fetchall()
|
results = cr.fetchall()
|
||||||
route2profile = {}
|
route2profile = {}
|
||||||
profile2product = defaultdict(lambda: env["product.template"])
|
profile2product = defaultdict(lambda: env["product.template"])
|
||||||
for row in results:
|
for row in results:
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
[build-system]
|
|
||||||
requires = ["whool"]
|
|
||||||
build-backend = "whool.buildapi"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
- Kévin Roche \<<kevin.roche@akretion.com>\>
|
|
||||||
1
product_route_profile/readme/CONTRIBUTORS.rst
Normal file
1
product_route_profile/readme/CONTRIBUTORS.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* Kévin Roche <kevin.roche@akretion.com>
|
||||||
@@ -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.
|
|
||||||
9
product_route_profile/readme/USAGE.rst
Normal file
9
product_route_profile/readme/USAGE.rst
Normal 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.
|
||||||
@@ -8,11 +8,10 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
:Author: David Goodger (goodger@python.org)
|
: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.
|
:Copyright: This stylesheet has been placed in the public domain.
|
||||||
|
|
||||||
Default cascading style sheet for the HTML output of Docutils.
|
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
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||||
customize this style sheet.
|
customize this style sheet.
|
||||||
@@ -275,7 +274,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
|||||||
margin-left: 2em ;
|
margin-left: 2em ;
|
||||||
margin-right: 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, code { background-color: #eeeeee }
|
||||||
pre.code .comment, code .comment { color: #5C6576 }
|
pre.code .comment, code .comment { color: #5C6576 }
|
||||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||||
@@ -301,7 +300,7 @@ span.option {
|
|||||||
span.pre {
|
span.pre {
|
||||||
white-space: pre }
|
white-space: pre }
|
||||||
|
|
||||||
span.problematic, pre.problematic {
|
span.problematic {
|
||||||
color: red }
|
color: red }
|
||||||
|
|
||||||
span.section-subtitle {
|
span.section-subtitle {
|
||||||
@@ -369,10 +368,8 @@ ul.auto-toc {
|
|||||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
!! source digest: sha256:7cc88b31d2c501945a5fd15642253db4a45a0e955d04d5a2ba9d2ad131a9155d
|
!! 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&target_branch=17.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/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&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
|
<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>
|
||||||
of “route profile”, coming with a company-specific and priority route
|
|
||||||
profile.</p>
|
|
||||||
<p><strong>Table of contents</strong></p>
|
<p><strong>Table of contents</strong></p>
|
||||||
<div class="contents local topic" id="contents">
|
<div class="contents local topic" id="contents">
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
@@ -389,12 +386,13 @@ profile.</p>
|
|||||||
</div>
|
</div>
|
||||||
<div class="section" id="usage">
|
<div class="section" id="usage">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
|
||||||
<p><strong>Route profile</strong> In Inventory > Configuration > Settings > Routes
|
<p><strong>Route profile</strong>
|
||||||
Profiles - Create some Route profile depending on your needs</p>
|
In Inventory > Configuration > Settings > Routes Profiles
|
||||||
<p><strong>On product</strong> On each template product, in inventory page, we can
|
- Create some Route profile depending on your needs</p>
|
||||||
select: - <strong>Route Profile</strong>: a default profile, common to all companies
|
<p><strong>On product</strong>
|
||||||
- <strong>Priority Route Profile</strong>: a profile specific to each company and
|
On each template product, in inventory page, we can select:
|
||||||
priority if existing.</p>
|
- <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>
|
||||||
<div class="section" id="known-issues-roadmap">
|
<div class="section" id="known-issues-roadmap">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
|
<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>.
|
<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.
|
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
|
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>
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="credits">
|
<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">
|
<div class="section" id="maintainers">
|
||||||
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
|
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
|
||||||
<p>This module is maintained by the OCA.</p>
|
<p>This module is maintained by the OCA.</p>
|
||||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||||
<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
|
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||||
mission is to support the collaborative development of Odoo features and
|
mission is to support the collaborative development of Odoo features and
|
||||||
promote its widespread use.</p>
|
promote its widespread use.</p>
|
||||||
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</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><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>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
<xpath expr="//group[@name='operations']" position="inside">
|
<xpath expr="//group[@name='operations']" position="inside">
|
||||||
<field
|
<field
|
||||||
name="route_profile_id"
|
name="route_profile_id"
|
||||||
invisible="type not in ['product', 'consu']"
|
attrs="{'invisible': [('type', 'not in', ['product', 'consu'])], 'required': [('type', 'in', ['product', 'consu'])]}"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="force_route_profile_id"
|
name="force_route_profile_id"
|
||||||
invisible="type not in ['product', 'consu']"
|
attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}"
|
||||||
/>
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
1
setup/product_route_profile/odoo/addons/product_route_profile
Symbolic link
1
setup/product_route_profile/odoo/addons/product_route_profile
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
../../../../product_route_profile
|
||||||
6
setup/product_route_profile/setup.py
Normal file
6
setup/product_route_profile/setup.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import setuptools
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
setup_requires=['setuptools-odoo'],
|
||||||
|
odoo_addon=True,
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user