Skip to content

Commit

Permalink
[ADD] sale_stock_service_level
Browse files Browse the repository at this point in the history
  • Loading branch information
petrus-v committed Dec 26, 2024
1 parent f3d1eda commit ef3d23a
Show file tree
Hide file tree
Showing 16 changed files with 771 additions and 0 deletions.
83 changes: 83 additions & 0 deletions sale_stock_service_level/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
========================
Sale stock service level
========================

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

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

This offer a default behavior while confirming sale order to set the
**stock service level** to be use by `stock_service_level` (and
`stock_service_level_route`) modules.

This module add a computed field on sale order line that can be adapted to your needs.

This service level is used while calling the procurement method while confirming the sale order
and propagated to stock.move in order to apply rule or reservation rule on it.

**Table of contents**

.. contents::
:local:

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

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

* Pierre Verkest <[email protected]>

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

* Pierre Verkest <[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/sale-workflow <https://github.com/OCA/sale-workflow/tree/14.0/sale_stock_service_level>`_ 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 sale_stock_service_level/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions sale_stock_service_level/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Foodles (https://www.foodles.co)
# @author Pierre Verkest <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sale stock service level",
"Summary": "Sale different service level per products.",
"version": "14.0.0.1.0",
"development_status": "Beta",
"author": "Pierre Verkest <[email protected]>, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"category": "Warehouse Management",
"depends": [
"sale_stock",
"stock_service_level",
],
"installable": True,
"license": "AGPL-3",
"data": [
"views/sale_order_views.xml",
],
}
55 changes: 55 additions & 0 deletions sale_stock_service_level/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_service_level
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__display_name
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__display_name
msgid "Display Name"
msgstr "Libellé"

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__id
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__id
msgid "ID"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order____last_update
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line____last_update
msgid "Last Modified on"
msgstr "Dernière date de modification"

#. module: sale_stock_service_level
#: model:ir.model,name:sale_stock_service_level.model_sale_order
msgid "Sales Order"
msgstr "Devis/Commande"

#. module: sale_stock_service_level
#: model:ir.model,name:sale_stock_service_level.model_sale_order_line
msgid "Sales Order Line"
msgstr "Ligne de commande"

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__service_level_id
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__service_level_id
msgid "Service level"
msgstr "Prestation"

#. module: sale_stock_service_level
#: model:ir.model.fields,help:sale_stock_service_level.field_sale_order__service_level_id
#: model:ir.model.fields,help:sale_stock_service_level.field_sale_order_line__service_level_id
msgid "The service level."
msgstr "Prestation"
54 changes: 54 additions & 0 deletions sale_stock_service_level/i18n/sale_stock_service_level.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * sale_stock_service_level
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0+e\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__display_name
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__display_name
msgid "Display Name"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__id
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__id
msgid "ID"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order____last_update
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line____last_update
msgid "Last Modified on"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model,name:sale_stock_service_level.model_sale_order
msgid "Sales Order"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model,name:sale_stock_service_level.model_sale_order_line
msgid "Sales Order Line"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order__service_level_id
#: model:ir.model.fields,field_description:sale_stock_service_level.field_sale_order_line__service_level_id
msgid "Service level"
msgstr ""

#. module: sale_stock_service_level
#: model:ir.model.fields,help:sale_stock_service_level.field_sale_order__service_level_id
#: model:ir.model.fields,help:sale_stock_service_level.field_sale_order_line__service_level_id
msgid "The service level."
msgstr ""
2 changes: 2 additions & 0 deletions sale_stock_service_level/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import sale_order_line
from . import sale_order
15 changes: 15 additions & 0 deletions sale_stock_service_level/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2024 Foodles (https://www.foodles.co)
# @author Pierre Verkest <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class SaleOrder(models.Model):
_inherit = "sale.order"

service_level_id = fields.Many2one(
string="Service level",
index="btree_not_null",
comodel_name="stock.service.level",
help="The service level.",
)
21 changes: 21 additions & 0 deletions sale_stock_service_level/models/sale_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Foodles (https://www.foodles.co)
# @author Pierre Verkest <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models


class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

service_level_id = fields.Many2one(
comodel_name="stock.service.level",
string="Service level",
related="order_id.service_level_id",
help="The service level.",
)

def _prepare_procurement_values(self, group_id=False):
return {
**super()._prepare_procurement_values(group_id=group_id),
"service_level_id": self.service_level_id.id,
}
1 change: 1 addition & 0 deletions sale_stock_service_level/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Pierre Verkest <[email protected]>
8 changes: 8 additions & 0 deletions sale_stock_service_level/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This offer a default behavior while confirming sale order to set the
**stock service level** to be use by `stock_service_level` (and
`stock_service_level_route`) modules.

This module add a computed field on sale order line that can be adapted to your needs.

This service level is used while calling the procurement method while confirming the sale order
and propagated to stock.move in order to apply rule or reservation rule on it.
Loading

0 comments on commit ef3d23a

Please sign in to comment.