Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
91 changes: 91 additions & 0 deletions product_route_profile_internal_resupply/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
=======================================
Product Route Profile Internal Resupply
=======================================

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

.. |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/18.0/product_route_profile_internal_resupply
: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-18-0/stock-logistics-warehouse-18-0-product_route_profile_internal_resupply
: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=18.0
:alt: Try me on Runboat

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

This module allows to add Internal Supplies Routes separately to other
routes in route_profile.

**Table of contents**

.. contents::
:local:

Usage
=====

On a warehouse, set another warehouse in "Ressuply From" and select the
relative route in "Internal Supplies" on product template.

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_internal_resupply%0Aversion:%2018.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 <kevin.roche@akretion.com>

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/18.0/product_route_profile_internal_resupply>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions product_route_profile_internal_resupply/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions product_route_profile_internal_resupply/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Product Route Profile Internal Resupply",
"summary": "SUMMARY",
"version": "18.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": [
"product_route_profile",
],
"data": [
"views/product_template.xml",
],
}
78 changes: 78 additions & 0 deletions product_route_profile_internal_resupply/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * product_route_profile_internal_resupply
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-11-11 13:17+0000\n"
"PO-Revision-Date: 2022-11-11 14:18+0100\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.2.1\n"

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_product_template__display_name
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_route_profile__display_name
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_location_route__display_name
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_warehouse__display_name
msgid "Display Name"
msgstr "Nom"

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_product_template__id
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_route_profile__id
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_location_route__id
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_warehouse__id
msgid "ID"
msgstr ""

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_location_route__internal_supply
msgid "Internal Supply"
msgstr "Réapprovisionnement Interne"

#. module: product_route_profile_internal_resupply
#: model:ir.model,name:product_route_profile_internal_resupply.model_stock_location_route
msgid "Inventory Routes"
msgstr "Routes logistiques"

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_product_template____last_update
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_route_profile____last_update
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_location_route____last_update
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_stock_warehouse____last_update
msgid "Last Modified on"
msgstr "Dernière modification le"

#. module: product_route_profile_internal_resupply
#: model:ir.model,name:product_route_profile_internal_resupply.model_product_template
msgid "Product Template"
msgstr "Modèle de produit"

#. module: product_route_profile_internal_resupply
#: model:ir.model,name:product_route_profile_internal_resupply.model_route_profile
msgid "Route Profile"
msgstr "Profil de routes"

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_route_profile__route_ids
msgid "Routes"
msgstr "Routes"

#. module: product_route_profile_internal_resupply
#: model:ir.model,name:product_route_profile_internal_resupply.model_stock_warehouse
msgid "Warehouse"
msgstr "Entrepôt"

#. module: product_route_profile_internal_resupply
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_product_product__internal_supply_ids
#: model:ir.model.fields,field_description:product_route_profile_internal_resupply.field_product_template__internal_supply_ids
msgid "internal Supplies"
msgstr "Réappro. Internes"
4 changes: 4 additions & 0 deletions product_route_profile_internal_resupply/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from . import product_template
from . import stock_route
from . import stock_warehouse
from . import route_profile
34 changes: 34 additions & 0 deletions product_route_profile_internal_resupply/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (C) 2022 Akretion (<http://www.akretion.com>).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ProductTemplate(models.Model):
_inherit = "product.template"

internal_supply_ids = fields.Many2many(
comodel_name="stock.route",
string="internal Supplies",
domain=[
("internal_supply", "=", True),
],
)

@api.depends("internal_supply_ids")
def _compute_route_ids(self):
return super()._compute_route_ids()

def _get_routes(self):
return super()._get_routes() | self.internal_supply_ids

def _get_or_create_profile(self, profiles, routes):
routes -= self.internal_supply_ids
return super()._get_or_create_profile(profiles, routes)

def _search_route_ids(self, operator, value):
res = super()._search_route_ids(operator, value)
res.insert(1, "|")
res.insert(2, ("internal_supply_ids", operator, value))
return res
15 changes: 15 additions & 0 deletions product_route_profile_internal_resupply/models/route_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class RouteProfile(models.Model):
_inherit = "route.profile"

route_ids = fields.Many2many(
"stock.route",
string="Routes",
domain=[("product_selectable", "=", True), ("internal_supply", "=", False)],
)
11 changes: 11 additions & 0 deletions product_route_profile_internal_resupply/models/stock_route.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright (C) 2022 Akretion (<http://www.akretion.com>).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class StockRoute(models.Model):
_inherit = "stock.route"

internal_supply = fields.Boolean(readonly=True)
14 changes: 14 additions & 0 deletions product_route_profile_internal_resupply/models/stock_warehouse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2022 Akretion (https://www.akretion.com).
# @author Kévin Roche <kevin.roche@akretion.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockWarehouse(models.Model):
_inherit = "stock.warehouse"

def _get_inter_warehouse_route_values(self, supplier_warehouse):
res = super()._get_inter_warehouse_route_values(supplier_warehouse)
res["internal_supply"] = True
return res
3 changes: 3 additions & 0 deletions product_route_profile_internal_resupply/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Kévin Roche \<kevin.roche@akretion.com\>
2 changes: 2 additions & 0 deletions product_route_profile_internal_resupply/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows to add Internal Supplies Routes separately to other
routes in route_profile.
2 changes: 2 additions & 0 deletions product_route_profile_internal_resupply/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
On a warehouse, set another warehouse in "Ressuply From" and select the
relative route in "Internal Supplies" on product template.
Loading
Loading