Skip to content

Commit

Permalink
[ADD] - add stock_release_channel_shipment_advice_toursolver
Browse files Browse the repository at this point in the history
Use TourSolver to plan shipment advices for ready and released pickings.
  • Loading branch information
sbejaoui committed Feb 22, 2023
1 parent 31011c8 commit 46cf39a
Show file tree
Hide file tree
Showing 19 changed files with 856 additions and 0 deletions.
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,
)
74 changes: 74 additions & 0 deletions stock_release_channel_shipment_advice_toursolver/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
================================================
Stock Release Channel Shipment Advice Toursolver
================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fwms-lightgray.png?logo=github
:target: https://github.com/OCA/wms/tree/16.0/stock_release_channel_shipment_advice_toursolver
:alt: OCA/wms
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/wms-16-0/wms-16-0-stock_release_channel_shipment_advice_toursolver
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/wms&target_branch=16.0
:alt: Try me on Runboat

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

Use TourSolver to plan shipment advices for ready and released pickings.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/wms/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/wms/issues/new?body=module:%20stock_release_channel_shipment_advice_toursolver%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
~~~~~~~

* ACSONE SA/NV

Contributors
~~~~~~~~~~~~

* Laurent Mignon <[email protected]>
* Souheil Bejaoui <[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.

This module is part of the `OCA/wms <https://github.com/OCA/wms/tree/16.0/stock_release_channel_shipment_advice_toursolver>`_ 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 stock_release_channel_shipment_advice_toursolver/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
18 changes: 18 additions & 0 deletions stock_release_channel_shipment_advice_toursolver/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Release Channel Shipment Advice Toursolver",
"summary": """
Use TourSolver to plan shipment advices for ready and released pickings""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/wms",
"depends": [
"stock_release_channel_shipment_advice",
"shipment_advice_planner_toursolver",
],
"data": ["views/toursolver_task.xml", "views/stock_release_channel.xml"],
"demo": [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import stock_release_channel
from . import toursolver_task
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class StockReleaseChannel(models.Model):

_inherit = "stock.release.channel"

shipment_planning_method = fields.Selection(
selection_add=[("toursolver", "TourSolver")],
ondelete={"toursolver": "cascade"},
)
delivery_resource_ids = fields.Many2many(
comodel_name="toursolver.resource",
string="Delivery resources",
help="delivery resources to be considered in geo-optimazation",
)

def _get_new_planner(self):
self.ensure_one()
planner = super()._get_new_planner()
planner.delivery_resource_ids = self.delivery_resource_ids
return planner
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ToursolverTask(models.Model):

_inherit = "toursolver.task"

release_channel_id = fields.Many2one(
comodel_name="stock.release.channel", string="Release Channel", readonly=True
)

def _get_new_shipment_advice_planer(self, resource, pickings_to_plan):
planner = super()._get_new_shipment_advice_planer(resource, pickings_to_plan)
planner.release_channel_id = self.release_channel_id
planner.picking_to_plan_ids = pickings_to_plan
return planner
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Laurent Mignon <[email protected]>
* Souheil Bejaoui <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use TourSolver to plan shipment advices for ready and released pickings.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 46cf39a

Please sign in to comment.