Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syncing from upstream OCA/stock-logistics-workflow (15.0) #1081

Merged
merged 10 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ addon | version | maintainers | summary
[sale_order_global_stock_route](sale_order_global_stock_route/) | 15.0.1.0.0 | | Add the possibility to choose one warehouse path for an order
[stock_account_product_run_fifo_hook](stock_account_product_run_fifo_hook/) | 15.0.1.0.0 | | Add more flexibility in the run fifo method.
[stock_delivery_note](stock_delivery_note/) | 15.0.1.0.0 | | This module allows to fill in a delivery note that will be displayed on delivery report
[stock_landed_costs_delivery](stock_landed_costs_delivery/) | 15.0.2.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Stock landed costs delivery
[stock_landed_costs_delivery](stock_landed_costs_delivery/) | 15.0.2.0.1 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Stock landed costs delivery
[stock_landed_costs_purchase_auto](stock_landed_costs_purchase_auto/) | 15.0.2.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Stock landed costs purchase auto
[stock_landed_costs_security](stock_landed_costs_security/) | 15.0.1.0.0 | [![cesar-tecnativa](https://github.com/cesar-tecnativa.png?size=30px)](https://github.com/cesar-tecnativa) | Stock landed costs security
[stock_lot_on_hand_first](stock_lot_on_hand_first/) | 15.0.1.0.0 | [![grindtildeath](https://github.com/grindtildeath.png?size=30px)](https://github.com/grindtildeath) | Allows to display lots on hand first in M2o fields
Expand Down Expand Up @@ -73,6 +73,7 @@ addon | version | maintainers | summary
[stock_picking_show_return](stock_picking_show_return/) | 15.0.1.0.0 | | Show returns on stock pickings
[stock_picking_warn_message](stock_picking_warn_message/) | 15.0.1.0.1 | | Add a popup warning on picking to ensure warning is populated
[stock_picking_whole_scrap](stock_picking_whole_scrap/) | 15.0.1.0.2 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Create whole scrap from a picking for move lines
[stock_product_set](stock_product_set/) | 15.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Add product sets in pickings
[stock_production_lot_active](stock_production_lot_active/) | 15.0.1.0.2 | [![ThomasBinsfeld](https://github.com/ThomasBinsfeld.png?size=30px)](https://github.com/ThomasBinsfeld) | Allow to archive/unarchive a lot.
[stock_production_lot_traceability](stock_production_lot_traceability/) | 15.0.1.0.1 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Drill down/up the lots produced or consumed
[stock_push_delay](stock_push_delay/) | 15.0.1.0.0 | | Manual evaluation of Push rules
Expand Down
2 changes: 1 addition & 1 deletion setup/_metapackage/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.0.20240113.0
15.0.20240117.0
1 change: 1 addition & 0 deletions setup/_metapackage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
'odoo-addon-stock_picking_show_return>=15.0dev,<15.1dev',
'odoo-addon-stock_picking_warn_message>=15.0dev,<15.1dev',
'odoo-addon-stock_picking_whole_scrap>=15.0dev,<15.1dev',
'odoo-addon-stock_product_set>=15.0dev,<15.1dev',
'odoo-addon-stock_production_lot_active>=15.0dev,<15.1dev',
'odoo-addon-stock_production_lot_traceability>=15.0dev,<15.1dev',
'odoo-addon-stock_push_delay>=15.0dev,<15.1dev',
Expand Down
1 change: 1 addition & 0 deletions setup/stock_product_set/odoo/addons/stock_product_set
6 changes: 6 additions & 0 deletions setup/stock_product_set/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,
)
2 changes: 1 addition & 1 deletion stock_landed_costs_delivery/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Stock landed costs delivery
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:93fe6ecc83a79dcb582ee1a91bc2803597c6de419bcf65c535822086c186bd2f
!! source digest: sha256:a1ff3f74ed89cad18c0fd8fe165e2930769f00e48c602cf148cfe5fb6095b395
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion stock_landed_costs_delivery/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Stock landed costs delivery",
"version": "15.0.2.0.0",
"version": "15.0.2.0.1",
"category": "Inventory",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
Expand Down
7 changes: 6 additions & 1 deletion stock_landed_costs_delivery/models/purchase_order.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023 Tecnativa - Víctor Martínez
# Copyright 2021-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models

Expand All @@ -23,6 +23,11 @@ def _create_delivery_line(self, carrier, price_unit):
if carrier.create_landed_cost_line:
vals = self._prepare_landed_cost_line_delivery_values(carrier, price_unit)
lc = self.sudo().landed_cost_ids.filtered(lambda x: x.state == "draft")
# Use the context to identify which picking is being generated from and
# set cost lines in the correct Landed cost.
if self.env.context.get("from_picking"):
picking = self.env.context.get("from_picking")
lc = lc.filtered(lambda x: picking in x.picking_ids)
if lc:
lc[0].cost_lines = [(0, 0, vals)]
return res
8 changes: 7 additions & 1 deletion stock_landed_costs_delivery/models/stock_picking.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Tecnativa - Víctor Martínez
# Copyright 2023-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.tools import config
Expand All @@ -7,6 +7,12 @@
class StockPicking(models.Model):
_inherit = "stock.picking"

def _add_delivery_cost_to_po(self):
"""We add the context to identify in _create_delivery_line() method the picking."""
self.ensure_one()
self = self.with_context(from_picking=self)
return super()._add_delivery_cost_to_po()

def _action_done(self):
"""Validate Landed costs linked to the purchase and picking."""
res = super()._action_done()
Expand Down
2 changes: 1 addition & 1 deletion stock_landed_costs_delivery/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ <h1 class="title">Stock landed costs delivery</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:93fe6ecc83a79dcb582ee1a91bc2803597c6de419bcf65c535822086c186bd2f
!! source digest: sha256:a1ff3f74ed89cad18c0fd8fe165e2930769f00e48c602cf148cfe5fb6095b395
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/stock-logistics-workflow/tree/15.0/stock_landed_costs_delivery"><img alt="OCA/stock-logistics-workflow" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--workflow-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/stock-logistics-workflow-15-0/stock-logistics-workflow-15-0-stock_landed_costs_delivery"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-workflow&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This addon adds a cost line with the carrier of the purchase order and the price.</p>
Expand Down
46 changes: 44 additions & 2 deletions stock_landed_costs_delivery/tests/test_purchase_order.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021-2023 Tecnativa - Víctor Martínez
# Copyright 2021-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)

from odoo.tests.common import users
Expand Down Expand Up @@ -61,7 +61,8 @@ def test_order_with_lc_carrier_id(self):
lc_cost_line.split_method, self.carrier.split_method_landed_cost_line
)

def test_order_with_lc_carrier_id_multi(self):
def test_order_with_lc_carrier_id_multi_01(self):
"""Order > Carrier. Picking 1 > Carrier. Picking 2 > Carrier."""
self.order.order_line.product_qty = 2
self.order.button_confirm()
picking = self.order.picking_ids
Expand All @@ -88,3 +89,44 @@ def test_order_with_lc_carrier_id_multi(self):
self.carrier.split_method_landed_cost_line,
extra_lc.cost_lines.split_method,
)

def test_order_with_lc_carrier_id_multi_02(self):
"""Order > No Carrier. Picking 1 > No Carrier. Picking 2 > Carrier."""
self.order.carrier_id = False
self.order.order_line.product_qty = 2
self.order.button_confirm()
picking = self.order.picking_ids
self.assertEqual(len(self.order.landed_cost_ids), 1)
lc = self.order.landed_cost_ids
self.assertEqual(len(lc.cost_lines), 0)
self.assertEqual(lc.state, "draft")
for move in picking.move_ids_without_package:
move.quantity_done = 1
self._action_picking_validate(picking)
# Picking without carrier and LC without cost lines and draft state
self.assertFalse(picking.carrier_id)
self.assertEqual(len(self.order.landed_cost_ids), 2)
extra_lc = self.order.landed_cost_ids - lc
self.assertEqual(len(lc.cost_lines), 0)
self.assertEqual(lc.state, "draft")
self.assertEqual(extra_lc.state, "draft")
new_picking = self.order.picking_ids - picking
new_picking.carrier_id = self.carrier
self._action_picking_validate(new_picking)
# Order with carrier, delivery price and delivery line
self.assertEqual(self.order.carrier_id, self.carrier)
self.assertEqual(self.order.delivery_price, 10)
self.assertEqual(
len(self.order.order_line.filtered(lambda x: x.is_delivery)), 1
)
# LC keep draft state
self.assertEqual(lc.state, "draft")
# Extra LC done (cost line from delivery)
self.assertEqual(len(extra_lc.cost_lines), 1)
self.assertEqual(extra_lc.state, "done")
self.assertEqual(self.carrier.product_id, extra_lc.cost_lines.product_id)
self.assertEqual(extra_lc.cost_lines.price_unit, 10)
self.assertEqual(
self.carrier.split_method_landed_cost_line,
extra_lc.cost_lines.split_method,
)
4 changes: 2 additions & 2 deletions stock_picking_backorder_strategy/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ msgstr ""
"Project-Id-Version: stock-logistics-workflow (8.0)\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-08 17:05+0000\n"
"PO-Revision-Date: 2023-11-24 16:34+0000\n"
"PO-Revision-Date: 2024-01-15 12:37+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: Italian (http://www.transifex.com/oca/"
"OCA-stock-logistics-workflow-8-0/language/it/)\n"
Expand Down Expand Up @@ -39,7 +39,7 @@ msgstr "Crea"
#. module: stock_picking_backorder_strategy
#: model:ir.model.fields,help:stock_picking_backorder_strategy.field_stock_picking_type__backorder_strategy
msgid "Define what to do with backorder"
msgstr "Definisci cosa fare con il backorder"
msgstr "Definisce cosa fare con gli ordini residui"

#. module: stock_picking_backorder_strategy
#: model:ir.model.fields.selection,name:stock_picking_backorder_strategy.selection__stock_picking_type__backorder_strategy__manual
Expand Down
6 changes: 3 additions & 3 deletions stock_picking_import_serial_number/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-12-29 17:33+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"PO-Revision-Date: 2024-01-16 18:36+0000\n"
"Last-Translator: Francesco Foresti <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -138,7 +138,7 @@ msgstr "Riferimento"
#: model:ir.model.fields,field_description:stock_picking_import_serial_number.field_res_config_settings__default_sn_search_product_by_field
#: model:ir.model.fields,field_description:stock_picking_import_serial_number.field_stock_picking_import_serial_number_wiz__sn_search_product_by_field
msgid "Search product by field"
msgstr "Cerca prodotto da campo"
msgstr "Cerca prodotto per campo"

#. module: stock_picking_import_serial_number
#: model_terms:ir.ui.view,arch_db:stock_picking_import_serial_number.res_config_settings_view_form
Expand Down
100 changes: 100 additions & 0 deletions stock_product_set/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
============================
Add product sets in pickings
============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1587ff2f78c0d081de9478f72c40d9e0ed233c62cca6a7904251a33f68663fe9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/15.0/stock_product_set
: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-15-0/stock-logistics-workflow-15-0-stock_product_set
: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=15.0
:alt: Try me on Runboat

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

This module allows to use product sets in planned transfer pickings.

**Table of contents**

.. contents::
:local:

Usage
=====

#. Go to *Inventory -> Delivery orders* and create new 'Planned transfer' (an option
available by clicking on the 3 dots in the upper right-hand corner).
#. Go to *Add set* button and select some product set and click on the *Add set* button.
#. Lines for each product of the set have been created in the *Stock Info* tab.

Known issues / Roadmap
======================

* The dependency sale_product_set must be changed to product_set in v16.

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_product_set%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
~~~~~~~

* Tecnativa

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

* `Tecnativa <https://www.tecnativa.com>`_:

* Víctor Martínez
* Pedro M. Baeza

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-victoralmau| image:: https://github.com/victoralmau.png?size=40px
:target: https://github.com/victoralmau
:alt: victoralmau

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

|maintainer-victoralmau|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions stock_product_set/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
19 changes: 19 additions & 0 deletions stock_product_set/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2023-2024 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Add product sets in pickings",
"version": "15.0.1.0.0",
"category": "Warehouse",
"website": "https://github.com/OCA/stock-logistics-workflow",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
# Correct dependency is product_set in v16
"depends": ["stock", "sale_product_set"],
"installable": True,
"data": [
"security/ir.model.access.csv",
"wizard/product_set_add_from_picking_views.xml",
"views/stock_picking_views.xml",
],
"maintainers": ["victoralmau"],
}
Loading
Loading