Skip to content

Commit

Permalink
[ADD] mrp_production_date_planned_finished_calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
LoisRForgeFlow committed Nov 18, 2024
1 parent 5141394 commit 62aa225
Show file tree
Hide file tree
Showing 14 changed files with 652 additions and 0 deletions.
84 changes: 84 additions & 0 deletions mrp_production_date_planned_finished_calendar/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
=============================================
MRP Production Date Planned Finished Calendar
=============================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:dfe27f551e8bd826eacd465bf8752bcc528b7f000525d006fa4c6d1a51280a79
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/15.0/mrp_production_date_planned_finished_calendar
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-15-0/manufacture-15-0-mrp_production_date_planned_finished_calendar
: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/manufacture&target_branch=15.0
:alt: Try me on Runboat

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

Glue module between `mrp_production_date_planned_finished` and `mrp_warehouse_calendar`.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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/manufacture/issues/new?body=module:%20mrp_production_date_planned_finished_calendar%0Aversion:%2015.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
~~~~~~~

* ForgeFlow

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

* Lois Rilo <[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-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px
:target: https://github.com/LoisRForgeFlow
:alt: LoisRForgeFlow

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

|maintainer-LoisRForgeFlow|

This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/15.0/mrp_production_date_planned_finished_calendar>`_ 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 mrp_production_date_planned_finished_calendar/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions mrp_production_date_planned_finished_calendar/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "MRP Production Date Planned Finished Calendar",
"summary": "Allows to plan production from the desired finish date",
"version": "15.0.1.0.0",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"maintainers": ["LoisRForgeFlow"],
"website": "https://github.com/OCA/manufacture",
"license": "AGPL-3",
"category": "Manufacturing",
"depends": ["mrp_production_date_planned_finished", "mrp_warehouse_calendar"],
"data": ["views/mrp_production.xml"],
"auto_install": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import mrp_production
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import models


class MrpProduction(models.Model):
_inherit = "mrp.production"

def _get_date_planned_start_using_delays(self):
warehouse = self.picking_type_id.warehouse_id
date_planned_start = self.date_planned_finished
if warehouse.calendar_id:
# See `mrp_warehouse_calendar` module.
delay = self.product_id.produce_delay + self.company_id.manufacturing_lead
return warehouse.calendar_id.plan_days(-1 * (delay + 1), date_planned_start)
return super()._get_date_planned_start_using_delays()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Lois Rilo <[email protected]>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Glue module between `mrp_production_date_planned_finished` and `mrp_warehouse_calendar`.
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 62aa225

Please sign in to comment.