Skip to content

Commit

Permalink
Merge PR #3 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rousseldenis
  • Loading branch information
OCA-git-bot committed Nov 13, 2023
2 parents bcb0385 + 8249771 commit 5a81980
Show file tree
Hide file tree
Showing 31 changed files with 2,203 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_location_orderpoint/setup.py
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,
)
140 changes: 140 additions & 0 deletions stock_location_orderpoint/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
=========================
stock_location_orderpoint
=========================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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%2Fstock--logistics--orderpoint-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-orderpoint/tree/16.0/stock_location_orderpoint
:alt: OCA/stock-logistics-orderpoint
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-orderpoint-16-0/stock-logistics-orderpoint-16-0-stock_location_orderpoint
: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/stock-logistics-orderpoint&target_branch=16.0
:alt: Try me on Runboat

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

Declare orderpoint on a location allowing to replenish any product with the same criteria.
This is for an internal warehouse replenishment currently not compatible with the purchase buy route.

**Table of contents**

.. contents::
:local:

Configuration
=============

First configuration
===================

#. In order to replenish your stock location from another one, you first need
to set the multi locations configuration.
#. So, go to Inventory > Configuration > Settings > Warehouse
#. Check the 'Storage Locations' box.
#. As you should be able to configure a dedicated route to replenishment, you
should also activate, in the same menu, the 'Multi-Step Routes' box.

Locations configuration
=======================

#. Identify the location you want to apply a replenishment rule (e.g.: WH/Stock)
#. Create (if not exists) a new location for replenishment under Warehouse view (e.g.: WH)
location as we want to get the stock in replenishment taken into account of
our product stock total quantity.

Route Configuration
===================

#. You should configure at least a route with a rule that:

* Pull from the Replenishment stock location.
* For the stock location you want to (e.g.: WH/Stock)

Location Orderpoint configuration
=================================

#. Go either by the stock location you want to replenish and click on 'Orderpoints'
or go to Inventory > Configuration > Settings > Warehouse > Stock Location Orderpoint
#. Click on 'Create'
#. Set a sequence
#. Choose if the rule will be applied:

* Automatically (Auto/realtime): at each stock movement on the stock location, the rule will be
evaluated.
* Manually (Manual): If set, an action 'Run Replenishment' will be displayed on the rule
and allow to run it manually.
* by cron (Scheduled): A cron job will trigger the replenishment rules of this kind.
#. Choose a replenish method:

* Fill up: The replenishment will be triggered when a move is waiting availability
and forecast quantity is negative at the location (i.e. min=0). The replenished quantity will
bring back the forecast quantity to 0 (i.e. max=0) but will be limited to what is available at
the source location to plan only reservable replenishment moves.
#. Choose the location to replenish
#. Choose the route to use to replenish. The source location will be computed automatically based on
the route value.
#. Define a procurement group if you want to group some movements together.
#. Define a priority for the created moves.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-orderpoint/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/stock-logistics-orderpoint/issues/new?body=module:%20stock_location_orderpoint%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
~~~~~~~

* MT Software
* BCIM

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

* Michael Tietz (MT Software) <[email protected]>
* Jacques-Etienne Baudoux (BCIM) <[email protected]>
* Denis Roussel <[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-mt-software-de| image:: https://github.com/mt-software-de.png?size=40px
:target: https://github.com/mt-software-de
:alt: mt-software-de

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-mt-software-de|

This module is part of the `OCA/stock-logistics-orderpoint <https://github.com/OCA/stock-logistics-orderpoint/tree/16.0/stock_location_orderpoint>`_ 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 stock_location_orderpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
33 changes: 33 additions & 0 deletions stock_location_orderpoint/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2023 Michael Tietz (MT Software) <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "stock_location_orderpoint",
"author": "MT Software, BCIM, Odoo Community Association (OCA)",
"summary": "Declare orderpoint on a location "
"allowing to replenish any product with the same criteria.",
"version": "16.0.1.0.0",
"data": [
"security/ir.model.access.csv",
"data/ir_cron.xml",
"data/ir_sequence.xml",
"data/queue_job_channel.xml",
"data/queue_job_function.xml",
"views/stock_location_orderpoint_views.xml",
"views/stock_location.xml",
"views/menu.xml",
],
"demo": [
"demo/stock_location.xml",
"demo/stock_picking_type.xml",
"demo/stock_route.xml",
"demo/stock_location_orderpoint.xml",
],
"depends": [
"stock_helper",
"queue_job",
],
"license": "AGPL-3",
"maintainers": ["mt-software-de"],
"website": "https://github.com/OCA/stock-logistics-orderpoint",
}
17 changes: 17 additions & 0 deletions stock_location_orderpoint/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record forcecreate="True" id="ir_cron_location_replenishment" model="ir.cron">
<field name="name">Procurement: run location replenishment</field>
<field name="model_id" ref="model_stock_location_orderpoint" />
<field name="state">code</field>
<field name="code">
model.run_cron_replenishment()
</field>
<field eval="False" name="active" />
<field name="user_id" ref="base.user_root" />
<field name="interval_number">10</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall" />
</record>
</odoo>
11 changes: 11 additions & 0 deletions stock_location_orderpoint/data/ir_sequence.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="sequence_location_orderpoint" model="ir.sequence">
<field name="name">Stock locaation orderpoint</field>
<field name="code">stock.location.orderpoint</field>
<field name="prefix">LOP/</field>
<field name="padding">5</field>
<field name="number_next">1</field>
<field name="number_increment">1</field>
</record>
</odoo>
10 changes: 10 additions & 0 deletions stock_location_orderpoint/data/queue_job_channel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record
id="channel_stock_location_orderpoint_auto_replenishment"
model="queue.job.channel"
>
<field name="name">stock_location_orderpoint_auto_replenishment</field>
<field name="parent_id" ref="queue_job.channel_root" />
</record>
</odoo>
15 changes: 15 additions & 0 deletions stock_location_orderpoint/data/queue_job_function.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record
id="job_function_stock_location_orderpoint_moves_auto_replenish"
model="queue.job.function"
>
<field name="model_id" ref="model_stock_location_orderpoint" />
<field name="method">moves_auto_replenish</field>
<field
name="channel_id"
ref="channel_stock_location_orderpoint_auto_replenishment"
/>
<field name="retry_pattern" eval="{1: 1, 5: 5, 10: 10, 15: 30}" />
</record>
</odoo>
17 changes: 17 additions & 0 deletions stock_location_orderpoint/demo/stock_location.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="stock_location_replenish_view" model="stock.location">
<field name="name">Replenishment Zone</field>
<field
name="location_id"
model="stock.location"
eval="obj().env.ref('stock.stock_location_stock').location_id"
/>
</record>
<record id="stock_location_replenish" model="stock.location">
<field name="name">Replenishment Stock</field>
<field name="location_id" ref="stock_location_replenish_view" />
</record>
</odoo>
11 changes: 11 additions & 0 deletions stock_location_orderpoint/demo/stock_location_orderpoint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="stock_location_orderpoint_1" model="stock.location.orderpoint">
<field name="location_id" ref="stock.stock_location_stock" />
<field name="route_id" ref="stock_route_replenish" />
<field name="trigger">auto</field>
<field name="replenish_method">fill_up</field>
</record>
</odoo>
16 changes: 16 additions & 0 deletions stock_location_orderpoint/demo/stock_picking_type.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="stock_picking_type_replenish" model="stock.picking.type">
<field name="name">Replenishments</field>
<field name="code">internal</field>
<field name="default_location_dest_id" ref="stock.stock_location_stock" />
<field
name="default_location_src_id"
ref="stock_location_orderpoint.stock_location_replenish"
/>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="sequence_code">SRE</field>
</record>
</odoo>
24 changes: 24 additions & 0 deletions stock_location_orderpoint/demo/stock_route.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ACSONE SA/NV
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="stock_route_replenish" model="stock.route">
<field name="name">Replenishment Route</field>
<field name="product_selectable" eval="False" />
</record>

<record id="stock_rule_replenish" model="stock.rule">
<field name="name">Replenishment Rule</field>
<field
name="location_src_id"
ref="stock_location_orderpoint.stock_location_replenish"
/>
<field name="location_dest_id" ref="stock.stock_location_stock" />
<field name="route_id" ref="stock_location_orderpoint.stock_route_replenish" />
<field
name="picking_type_id"
ref="stock_location_orderpoint.stock_picking_type_replenish"
/>
<field name="action">pull</field>
</record>
</odoo>
Loading

0 comments on commit 5a81980

Please sign in to comment.