Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] product_route_profile #2199

Open
wants to merge 26 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b88cb1d
[ADD] module: product_route_profile
Kev-Roche Apr 27, 2022
241c242
[UPD] Update product_route_profile.pot
Oct 10, 2022
25f3e14
[UPD] README.rst
OCA-git-bot Oct 10, 2022
ebb65ca
[ADD] icon.png
OCA-git-bot Oct 10, 2022
3a945e3
product_route_profile 14.0.1.0.1
OCA-git-bot Oct 10, 2022
b6e79f5
[FIX] product_route_profile _inverse_route_ids store selected route_p…
awisky Apr 12, 2023
c8e82f7
product_route_profile 14.0.1.0.2
OCA-git-bot Apr 18, 2023
9a8625a
Added translation using Weblate (Dutch)
bosd Jun 23, 2023
c0e2ab5
[UPD] README.rst
OCA-git-bot Sep 3, 2023
ebc90d3
Update translation files
weblate Oct 9, 2023
0f613b1
*: Fix pylint
etobella Oct 29, 2023
498db66
[UPD] Update product_route_profile.pot
Oct 29, 2023
1ccec89
[BOT] post-merge updates
OCA-git-bot Oct 29, 2023
cf57bad
Update translation files
weblate Oct 29, 2023
5a11b67
[MIG] product_route_profile: Migration to 15.0
bosd Oct 31, 2023
0f1762c
[IMP] product_route_profile: add custom icon
bosd Oct 31, 2023
953beb6
[IMP] product_route_profile: pre-commit auto fixes
StefanRijnhart Jul 4, 2024
a360787
[MIG] product_route_profile: Migration to 17.0
StefanRijnhart Jul 4, 2024
4662c87
[FIX] product_route_profile: prevent triggering inverse method
bguillot Feb 8, 2024
746a215
[UPD] Update product_route_profile.pot
Oct 8, 2024
84826d3
[BOT] post-merge updates
OCA-git-bot Oct 8, 2024
40f8427
Update translation files
weblate Oct 8, 2024
0692a1c
Added translation using Weblate (Italian)
mymage Oct 9, 2024
05c3784
Translated using Weblate (Italian)
mymage Oct 9, 2024
94b43a8
[MIG] product_route_profile: migrate to V16
astirpe Nov 15, 2024
1cb9d93
[MIG] product_route_profile: route_profile_id not mandatory
astirpe Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions product_route_profile/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
=====================
Product Route Profile
=====================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7cc88b31d2c501945a5fd15642253db4a45a0e955d04d5a2ba9d2ad131a9155d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/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-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=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.

**Table of contents**

.. contents::
:local:

Usage
=====

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

Known issues / Roadmap
======================

Tests of this module are running separately than the other tests.

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:%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]>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

.. |maintainer-Kev-Roche| image:: https://github.com/Kev-Roche.png?size=40px
:target: https://github.com/Kev-Roche
:alt: Kev-Roche

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/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: 2 additions & 0 deletions product_route_profile/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_init_hook
25 changes: 25 additions & 0 deletions product_route_profile/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Kévin Roche <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Product Route Profile",
"summary": "Add Route profile concept on product",
"version": "16.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"author": "Akretion, Odoo Community Association (OCA)",
"maintainers": ["Kev-Roche"],
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"stock",
],
"data": [
"views/route_profile.xml",
"views/product_template.xml",
"security/ir.model.access.csv",
],
"post_init_hook": "post_init_hook",
}
41 changes: 41 additions & 0 deletions product_route_profile/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (C) 2022 Akretion (<http://www.akretion.com>).
# @author Kévin Roche <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from collections import defaultdict

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry):
def get_profile(route_ids):
route_ids = tuple(set(route_ids))
profile = route2profile.get(route_ids)
if not profile:
profile_name = ""
route_names = [rec.name for rec in env["stock.route"].browse(route_ids)]
profile_name = " / ".join(route_names)
profile = env["route.profile"].create(
{
"name": profile_name,
"route_ids": [(6, 0, 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;
"""
cr.execute(query)
results = cr.fetchall()
route2profile = {}
profile2product = defaultdict(lambda: env["product.template"])
for row in results:
profile = get_profile(row[1])
profile2product[profile.id] |= env["product.template"].browse(row[0])

for profile in profile2product:
profile2product[profile].write({"route_profile_id": profile})
128 changes: 128 additions & 0 deletions product_route_profile/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_route_profile
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-04-27 18:10+0000\n"
"PO-Revision-Date: 2022-04-27 20:13+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: \n"
"X-Generator: Poedit 3.0.1\n"

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__company_id
msgid "Company"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__create_uid
msgid "Created by"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__create_date
msgid "Created on"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,help:product_route_profile.field_product_product__route_ids
#: model:ir.model.fields,help:product_route_profile.field_product_template__route_ids
msgid ""
"Depending on the modules installed, this will allow you to define the route "
"of the product: whether it will be bought, manufactured, replenished on "
"order, etc."
msgstr ""
"En fonction des modules installés, cela va vous permettre de définir les "
"routes sur l'article: acheter, fabriquer, réapprovisionner sur commande, etc."

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__display_name
msgid "Display Name"
msgstr "Nom"

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__id
msgid "ID"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,help:product_route_profile.field_product_product__force_route_profile_id
#: model:ir.model.fields,help:product_route_profile.field_product_template__force_route_profile_id
msgid ""
"If defined, the priority route profile will be used and will replace the "
"route profile, only for this company."
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__write_uid
msgid "Last Updated by"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__write_date
msgid "Last Updated on"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__name
msgid "Name"
msgstr ""

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_product_product__force_route_profile_id
#: model:ir.model.fields,field_description:product_route_profile.field_product_template__force_route_profile_id
msgid "Priority Route Profile"
msgstr "Profil de Routes Prioritaires"

#. module: product_route_profile
#: model:ir.model,name:product_route_profile.model_product_template
msgid "Product"
msgstr ""

#. module: product_route_profile
#: model:ir.model,name:product_route_profile.model_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_product_product__route_profile_id
#: model:ir.model.fields,field_description:product_route_profile.field_product_template__route_profile_id
msgid "Route Profile"
msgstr "Profil de routes"

#. module: product_route_profile
#: model:ir.model.fields,field_description:product_route_profile.field_product_product__route_ids
#: model:ir.model.fields,field_description:product_route_profile.field_product_template__route_ids
#: model:ir.model.fields,field_description:product_route_profile.field_route_profile__route_ids
msgid "Routes"
msgstr "Routes"

#. module: product_route_profile
#: model:ir.actions.act_window,name:product_route_profile.action_route_profile_form
#: model:ir.ui.menu,name:product_route_profile.menu_route_profile_config
#: model_terms:ir.ui.view,arch_db:product_route_profile.route_profile_form
msgid "Routes Profiles"
msgstr "Profils de Routes"

#. module: product_route_profile
#: model_terms:ir.actions.act_window,help:product_route_profile.action_route_profile_form
msgid ""
"You can define here the routes profiles that run through\n"
" your warehouses and that define the flows of your products.\n"
" A route profile can be set on each product as \"Route "
"Profile\" or \"Priority Route Profile\" (company dependent)."
msgstr ""
"Vous pouvez définir ici les routes qui régissent les mouvements de vos "
"produits dans vos entrepôts. \n"
"Un profil de route peut être défini pour chaque produit en tant que \"Profil "
"de Routes\" ou \"Profil de Routes Prioritaires\" (société dépendant)."

#~ msgid "Last Modified on"
#~ msgstr "Dernière modification le"

#~ msgid "Product Template"
#~ msgstr "Modèle de produit"
Loading
Loading