Skip to content

Commit

Permalink
fixup! fix tests config
Browse files Browse the repository at this point in the history
  • Loading branch information
SilvioC2C committed Apr 16, 2024
1 parent 1eaf0e4 commit 2ab90d2
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 17 deletions.
114 changes: 113 additions & 1 deletion stock_warehouse_calendar_orderpoint/README.rst
Original file line number Diff line number Diff line change
@@ -1 +1,113 @@
waiting bot
===========================================
Stock Warehouse Calendar (reordering rules)
===========================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:71603635fc54c90766f0780453637f940e6bfc8d0169c7cbc5242cb4f7d9a1b0
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-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/14.0/stock_warehouse_calendar_orderpoint
: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-14-0/stock-logistics-warehouse-14-0-stock_warehouse_calendar_orderpoint
: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=14.0
:alt: Try me on Runboat

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

This module adds an Reordering Calendar to the Warehouse. This calendar
can then used by reordering rules to compute the forecasted date when goods
will be received.

**Table of contents**

.. contents::
:local:

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

* Go to *Settings* and activate the developer mode.

* Go to *Settings > Technical > Resource > Working Time* and define your
resource calendar.

* Go to *Inventory > Configuration > Settings > Warehouses*
and assign the calendar to the "Reordering Calendar" field.
This will be the default calendar for all newly created warehouses
for the current company.
Optionnaly you can choose to postpone the computed lead date to the next
available weekday.

* In *Inventory > Configuration > Warehouse Management > Warehouses*
you can set a different calendar for your warehouse.

Usage
=====

When dealing with reordering rules, the Reordering Calendar is considered in
the computation of the forecasted date to receive goods.
For example, if we plan to execute the reordering rules on a given weekday
(configuration of the Reordering Calendar), it will take this day as a
starting date instead of the current day (standard behavior).

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:%20stock_warehouse_calendar_orderpoint%0Aversion:%2014.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
~~~~~~~

* Camptocamp

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

* Sébastien Alix <[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-sebalix| image:: https://github.com/sebalix.png?size=40px
:target: https://github.com/sebalix
:alt: sebalix

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

|maintainer-sebalix|

This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/14.0/stock_warehouse_calendar_orderpoint>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
25 changes: 9 additions & 16 deletions stock_warehouse_calendar_orderpoint/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.product = cls.env.ref("product.product_delivery_02").copy()
cls.seller = cls.env["product.supplierinfo"].create(
cls.wh = cls.env.ref("stock.warehouse0")
cls.wh.write(
{
"name": cls.env.ref("base.res_partner_3").id,
"product_tmpl_id": cls.product.product_tmpl_id.id,
"product_id": cls.product.id,
"calendar_id": cls.env.ref("resource.resource_calendar_std").id,
"orderpoint_calendar_id": cls.env.ref(
"stock_warehouse_calendar_orderpoint.resource_calendar_orderpoint_demo"
).id,
"orderpoint_on_workday": True,
"orderpoint_on_workday_policy": "skip_to_first_workday",
}
)
cls.wh = cls.env.ref("stock.warehouse0")
cls.orderpoint = cls.env["stock.warehouse.orderpoint"].create(
{
"warehouse_id": cls.wh.id,
Expand All @@ -28,14 +31,4 @@ def setUpClass(cls):
"product_uom": cls.env.ref("uom.product_uom_unit"),
}
)
# OP calendar to compute lead dates from Wednesday
cls.wh.orderpoint_calendar_id = cls.env.ref(
"stock_warehouse_calendar_orderpoint.resource_calendar_orderpoint_demo"
)
cls.wh.orderpoint_on_workday = True
cls.wh.orderpoint_on_workday_policy = "skip_to_first_workday"
cls.wh.calendar_id = cls.env.ref("resource.resource_calendar_std")
# 1 day delay for supplier
cls.seller.delay = 1
# Rule lead time
cls.orderpoint.rule_ids.delay = 2
cls.orderpoint.rule_ids.write({"action": "pull", "delay": 2})

0 comments on commit 2ab90d2

Please sign in to comment.