Skip to content

Commit

Permalink
[IMP] stock_receipt_lot_info: black, isort, prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcBForgeFlow committed Oct 18, 2022
1 parent 5e3da22 commit 4ab7091
Show file tree
Hide file tree
Showing 17 changed files with 814 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_receipt_lot_info/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,
)
99 changes: 99 additions & 0 deletions stock_receipt_lot_info/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
======================
Stock Receipt Lot Info
======================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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-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--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_receipt_lot_info
:alt: OCA/stock-logistics-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-13-0/stock-logistics-workflow-13-0-stock_receipt_lot_info
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/154/13.0
:alt: Try me on Runbot

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

This module allows to encode more information to create lot/serial numbers
while processing an incoming shipment.

By default, you can only provide a lot/serial number name
when receiving products tracked by lot/serial numbers, with this module you can also
provide the following information of the lot:

* Lot/Serial End of Life Date.
* Lot/Serial Best before Date.
* Lot/Serial Removal Date.
* Lot/Serial Alert Date.

**Table of contents**

.. contents::
:local:

Usage
=====

To use the module act as follows while you process an incoming shipment.

#. In the detailed operations list view click on the optional columns and select
the information that is relevant for you.
#. Fill the lot/serial number name.
#. Fill whatever other extra field is relevant for you.
#. Fill the rest of information as usual.
#. Validate the operation.

Your lots will include now all the information you added during the reception.

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

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

* Forgeflow (https://www.forgeflow.com)

* Lois Rilo <lois.rilo@forgeflow.com>

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/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/13.0/stock_receipt_lot_info>`_ 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_receipt_lot_info/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import model
16 changes: 16 additions & 0 deletions stock_receipt_lot_info/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2021-22 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

{
"name": "Stock Receipt Lot Info",
"summary": "Be able to introduce more info on lot/serial "
"number while processing a receipt.",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"version": "15.0.1.0.0",
"category": "Warehouse Management",
"website": "https://github.com/OCA/stock-logistics-workflow",
"license": "LGPL-3",
"depends": ["stock", "product_expiry"],
"data": ["views/stock_move_line_views.xml"],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_account_product_run_fifo_hook
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\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: stock_account_product_run_fifo_hook
#: model:ir.model,name:stock_account_product_run_fifo_hook.model_product_product
msgid "Product"
msgstr ""
18 changes: 18 additions & 0 deletions stock_receipt_lot_info/migrations/15.0.1.0.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2022 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from openupgradelib import openupgrade # pylint: disable=W7936

_field_renames = [
("stock.move.line", "stock_move_line", "lot_life_date", "lot_expiration_date"),
]


@openupgrade.migrate()
def migrate(env, version):
cr = env.cr
for field in _field_renames:
if openupgrade.table_exists(cr, field[1]) and openupgrade.column_exists(
cr, field[1], field[2]
):
openupgrade.rename_fields(env, [field])
1 change: 1 addition & 0 deletions stock_receipt_lot_info/model/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move_line
27 changes: 27 additions & 0 deletions stock_receipt_lot_info/model/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2021 ForgeFlow, S.L.
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo import fields, models


class StockMoveLine(models.Model):
_inherit = "stock.move.line"

lot_expiration_date = fields.Datetime(string="Lot/Serial Expiration Date")
lot_use_date = fields.Datetime(string="Lot/Serial Best before Date")
lot_removal_date = fields.Datetime(string="Lot/Serial Removal Date")
lot_alert_date = fields.Datetime(string="Lot/Serial Alert Date")

def _prepare_new_lot_vals(self):
vals = super()._prepare_new_lot_vals()
creation_lot_fields = [
"expiration_date",
"use_date",
"removal_date",
"alert_date",
]
for field in creation_lot_fields:
value = getattr(self, "lot_" + field)
if value:
vals[field] = fields.Datetime.to_string(value)
return vals
3 changes: 3 additions & 0 deletions stock_receipt_lot_info/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Forgeflow (https://www.forgeflow.com)

* Lois Rilo <lois.rilo@forgeflow.com>
11 changes: 11 additions & 0 deletions stock_receipt_lot_info/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This module allows to encode more information to create lot/serial numbers
while processing an incoming shipment.

By default, you can only provide a lot/serial number name
when receiving products tracked by lot/serial numbers, with this module you can also
provide the following information of the lot:

* Lot/Serial Expiration Date.
* Lot/Serial Best before Date.
* Lot/Serial Removal Date.
* Lot/Serial Alert Date.
10 changes: 10 additions & 0 deletions stock_receipt_lot_info/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To use the module act as follows while you process an incoming shipment.

#. In the detailed operations list view click on the optional columns and select
the information that is relevant for you.
#. Fill the lot/serial number name.
#. Fill whatever other extra field is relevant for you.
#. Fill the rest of information as usual.
#. Validate the operation.

Your lots will include now all the information you added during the reception.
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 4ab7091

Please sign in to comment.