Skip to content

Commit

Permalink
[MIG]stock_picking_auto_create_lot: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinVinagre committed Oct 29, 2021
1 parent 9734e8f commit 4fbed3c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 17 deletions.
6 changes: 6 additions & 0 deletions setup/stock_picking_auto_create_lot/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,
)
10 changes: 5 additions & 5 deletions stock_picking_auto_create_lot/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Stock Picking Auto Create Lot
: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/13.0/stock_picking_auto_create_lot
:target: https://github.com/OCA/stock-logistics-workflow/tree/14.0/stock_picking_auto_create_lot
: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_picking_auto_create_lot
:target: https://translation.odoo-community.org/projects/stock-logistics-workflow-14-0/stock-logistics-workflow-14-0-stock_picking_auto_create_lot
: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
:target: https://runbot.odoo-community.org/runbot/154/14.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -61,7 +61,7 @@ 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_picking_auto_create_lot%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-workflow/issues/new?body=module:%20stock_picking_auto_create_lot%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.

Expand Down Expand Up @@ -103,6 +103,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sergio-teruel|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 1 addition & 1 deletion stock_picking_auto_create_lot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Stock Picking Auto Create Lot",
"summary": "Auto create lots for incoming pickings",
"version": "13.0.1.1.0",
"version": "14.0.1.0.0",
"development_status": "Production/Stable",
"category": "stock",
"website": "https://github.com/OCA/stock-logistics-workflow",
Expand Down
6 changes: 3 additions & 3 deletions stock_picking_auto_create_lot/models/stock_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ def _prepare_auto_lot_values(self):

def set_lot_auto(self):
"""
Create lots using create_multi to avoid too much queries
As move lines were created by product or by tracked 'serial'
products, we apply the lot with both different approaches.
Create lots using create_multi to avoid too much queries
As move lines were created by product or by tracked 'serial'
products, we apply the lot with both different approaches.
"""
values = []
production_lot_obj = self.env["stock.production.lot"]
Expand Down
6 changes: 3 additions & 3 deletions stock_picking_auto_create_lot/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StockPicking(models.Model):

def _set_auto_lot(self):
"""
Allows to be called either by button or through code
Allows to be called either by button or through code
"""
pickings = self.filtered(lambda p: p.picking_type_id.auto_create_lot)
lines = pickings.mapped("move_line_ids").filtered(
Expand All @@ -22,9 +22,9 @@ def _set_auto_lot(self):
)
lines.set_lot_auto()

def action_done(self):
def _action_done(self):
self._set_auto_lot()
return super().action_done()
return super()._action_done()

def button_validate(self):
self._set_auto_lot()
Expand Down
1 change: 1 addition & 0 deletions stock_picking_auto_create_lot/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
* Sergio Teruel <sergio.teruel@tecnativa.com>
* Pimolnat Suntian <pimolnats@ecosoft.co.th>
* Denis Roussel <denis.roussel@acsone.eu>
* Valentin Vinagre <valentin.vinagre@sygel.es>
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_auto_create_lot(self):
)
self.assertTrue(move.display_assign_serial)

self.picking.action_done()
self.picking._action_done()
lot = self.env["stock.production.lot"].search(
[("product_id", "=", self.product.id)]
)
Expand Down Expand Up @@ -121,9 +121,9 @@ def test_auto_create_transfer_lot(self):

def test_multi_auto_create_lot(self):
"""
Create two pickings
Try to validate them together
Check if lots have been assigned to each move
Create two pickings
Try to validate them together
Check if lots have been assigned to each move
"""
self.picking.action_assign()
picking_1 = self.picking
Expand All @@ -139,7 +139,7 @@ def test_multi_auto_create_lot(self):
for line in moves.mapped("move_line_ids"):
self.assertFalse(line.lot_id)

pickings.action_done()
pickings._action_done()
for line in moves.mapped("move_line_ids"):
self.assertTrue(line.lot_id)

Expand Down

0 comments on commit 4fbed3c

Please sign in to comment.