Skip to content

Commit

Permalink
[ADD] stock_picking_auto_create_lot_sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Jun 26, 2024
1 parent e6f3c42 commit 3ab894f
Show file tree
Hide file tree
Showing 11 changed files with 590 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_auto_create_lot_sequence/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,
)
71 changes: 71 additions & 0 deletions stock_picking_auto_create_lot_sequence/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
======================================
Stock Picking Auto Create Lot Sequence
======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a9a6e7e2ceaf2cf58433b95148d16e50b1fb860af3ee29423c614f182b9a66c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_picking_auto_create_lot_sequence
: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-16-0/stock-logistics-workflow-16-0-stock_picking_auto_create_lot_sequence
: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-workflow&target_branch=16.0
:alt: Try me on Runboat

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

This module acts as a bridge between the stock_picking_auto_create_lot and product_lot_sequence modules.

**Table of contents**

.. contents::
:local:

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_auto_create_lot_sequence%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
~~~~~~~

* Quartile

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/16.0/stock_picking_auto_create_lot_sequence>`_ 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_picking_auto_create_lot_sequence/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
11 changes: 11 additions & 0 deletions stock_picking_auto_create_lot_sequence/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2024 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Picking Auto Create Lot Sequence",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Quartile, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-workflow",
"depends": ["product_lot_sequence", "stock_picking_auto_create_lot"],
}
1 change: 1 addition & 0 deletions stock_picking_auto_create_lot_sequence/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_move_line
17 changes: 17 additions & 0 deletions stock_picking_auto_create_lot_sequence/models/stock_move_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2024 Quartile (https://www.quartile.co)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


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

def _get_lot_sequence(self):
self.ensure_one()
if not self.product_id.lot_sequence_id:
return super()._get_lot_sequence()
seq_policy = self.env["stock.lot"]._get_sequence_policy()
if seq_policy != "product":
return super()._get_lot_sequence()
return self.product_id.lot_sequence_id._next()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module acts as a bridge between the stock_picking_auto_create_lot and product_lot_sequence modules.
Loading

0 comments on commit 3ab894f

Please sign in to comment.