-
-
Notifications
You must be signed in to change notification settings - Fork 666
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] stock_quant_package_fast_move
- Loading branch information
1 parent
e8ebdf2
commit e48963d
Showing
26 changed files
with
1,010 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/stock_quant_package_fast_move/odoo/addons/stock_quant_package_fast_move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../stock_quant_package_fast_move |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
=================================== | ||
Fast Package Move Between Locations | ||
=================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:652bbb005309712f6a57d643565339e74880f1520033bac69c22e8133a165f3c | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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_quant_package_fast_move | ||
: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_quant_package_fast_move | ||
: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 simplifies package movement between different warehouse | ||
locations. | ||
|
||
You can simply select several packages and use a wizard that will | ||
perform all the underlying inventory operations. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Use Cases / Context | ||
=================== | ||
|
||
Imagine that you need to transfer different packages between different | ||
locations in your warehouse. | ||
|
||
Regular Odoo flow looks like this: | ||
|
||
- Go to the "Inventory -> Overview" and select an operation type (eg | ||
'Internal Transfer') | ||
|
||
- Create a corresponding picking | ||
|
||
- Add packages if 'Move Entire Packages' is enabled or add all the | ||
package products | ||
|
||
- Set quantities done | ||
|
||
- Validate | ||
|
||
However if you are working with packages you will primary operate from | ||
the "Packages" menu. | ||
|
||
And it would be much convenient if you could move packages directly from | ||
this menu. | ||
|
||
This is what this module is designed for. | ||
|
||
Configuration | ||
============= | ||
|
||
- Go to the "Inventory -> Configuration -> Settings" | ||
|
||
- Activate the "Packages" checkbox | ||
|
||
- In the "Package Move Operation" select the operation type that will | ||
be used for the easy package transfers. This setting is configured | ||
for each company separately | ||
|
||
Usage | ||
===== | ||
|
||
- Go to the "Inventory -> Products -> Packages" | ||
|
||
- Open a package or select several packages in the list vies. | ||
Important: all selected packages must be located in the same location | ||
|
||
- Open the "Action" menu and select "Move packages" | ||
|
||
- In the opened wizard select the destination location where you want | ||
to move the packages | ||
|
||
- You can select an optional destination package in the "Destination | ||
Package" field. If selected the content of the selected packages will | ||
be moved into the destination package located at the destination | ||
location. | ||
|
||
- Click the "Move" button | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
Only packages residing in the same source location can be moved. | ||
|
||
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_quant_package_fast_move%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 | ||
------- | ||
|
||
* Cetmix | ||
|
||
Contributors | ||
------------ | ||
|
||
- Cetmix https://cetmix.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. | ||
|
||
.. |maintainer-CetmixGitDrone| image:: https://github.com/CetmixGitDrone.png?size=40px | ||
:target: https://github.com/CetmixGitDrone | ||
:alt: CetmixGitDrone | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-CetmixGitDrone| | ||
|
||
This module is part of the `OCA/stock-logistics-workflow <https://github.com/OCA/stock-logistics-workflow/tree/16.0/stock_quant_package_fast_move>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import models | ||
from . import wizard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Fast Package Move Between Locations", | ||
"version": "16.0.1.0.0", | ||
"category": "Inventory/Inventory", | ||
"summary": "Move packages between locations directly from the 'Package' menu", | ||
"depends": ["stock_picking_move_package_to_package"], | ||
"website": "https://github.com/OCA/stock-logistics-workflow", | ||
"author": "Cetmix, Odoo Community Association (OCA)", | ||
"maintainers": ["CetmixGitDrone"], | ||
"installable": True, | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"wizard/stock_quant_package_fast_move_wizard.xml", | ||
"views/res_config_settings.xml", | ||
], | ||
"license": "AGPL-3", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import stock_quant_package | ||
from . import res_company | ||
from . import res_config_settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
picking_type_id = fields.Many2one( | ||
"stock.picking.type", string="Package Move Operation" | ||
) |
12 changes: 12 additions & 0 deletions
12
stock_quant_package_fast_move/models/res_config_settings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
picking_type_id = fields.Many2one( | ||
related="company_id.picking_type_id", readonly=False | ||
) |
82 changes: 82 additions & 0 deletions
82
stock_quant_package_fast_move/models/stock_quant_package.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import _, exceptions, models | ||
|
||
|
||
class StockQuantPackage(models.Model): | ||
_inherit = "stock.quant.package" | ||
|
||
def action_show_package_fast_move_wizard(self): | ||
"""Open wizard for fast package movement.""" | ||
return { | ||
"type": "ir.actions.act_window", | ||
"name": _("Move Packages"), | ||
"res_model": "stock.quant.package.fast.move.wizard", | ||
"target": "new", | ||
"view_id": self.env.ref( | ||
"stock_quant_package_fast_move.stock_quant_package_fast_move_wizard_view_form" | ||
).id, | ||
"view_mode": "form", | ||
"context": self.env.context, | ||
} | ||
|
||
def _move_to_location(self, location, destination_package=None): | ||
""" | ||
Move packages to a specified location. | ||
Parameters: | ||
- location (recordset of stock.location): The destination location. | ||
- destination_package (recordset of stock.quant.package, optional): | ||
Optional destination package. If provided, it must belong to the specified location. | ||
Returns: | ||
- bool: True if the move is successful. | ||
Raises: | ||
- exceptions.UserError: If the destination location is the same as the current location | ||
or if the destination package does not belong to the specified location. | ||
""" | ||
# Check if the location is different from the current location | ||
if location == self[0].location_id: | ||
raise exceptions.UserError( | ||
_("The destination location is the same as the current location.") | ||
) | ||
|
||
# Check if the destination package belongs to the same location | ||
if destination_package and destination_package.location_id != location: | ||
raise exceptions.UserError( | ||
_("The destination package does not belong to the specified location.") | ||
) | ||
|
||
active_company = self.env.company | ||
picking_type_id = active_company.picking_type_id | ||
|
||
# Create a picking | ||
picking_vals = { | ||
"location_id": self[0].location_id.id, | ||
"location_dest_id": location.id, | ||
"picking_type_id": picking_type_id.id, | ||
} | ||
picking = self.env["stock.picking"].create(picking_vals) | ||
|
||
for package in self: | ||
# Create a package_level record for each package | ||
package_level_vals = { | ||
"package_id": package.id, | ||
"package_dest_id": destination_package.id | ||
if destination_package | ||
else False, | ||
"picking_id": picking.id, | ||
"company_id": active_company.id, | ||
"location_id": package.location_id.id, | ||
"location_dest_id": location.id, | ||
} | ||
package_level = self.env["stock.package_level"].create(package_level_vals) | ||
package_level.write({"is_done": True}) | ||
|
||
# Validate the picking | ||
picking.action_confirm() | ||
picking.button_validate() | ||
|
||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- Go to the "Inventory -> Configuration -> Settings" | ||
|
||
- Activate the "Packages" checkbox | ||
|
||
- In the "Package Move Operation" select the operation type that will be used for the easy package transfers. This setting is configured for each company separately |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Imagine that you need to transfer different packages between different locations in your warehouse. | ||
|
||
Regular Odoo flow looks like this: | ||
|
||
- Go to the "Inventory -> Overview" and select an operation type (eg 'Internal Transfer') | ||
|
||
- Create a corresponding picking | ||
|
||
- Add packages if 'Move Entire Packages' is enabled or add all the package products | ||
|
||
- Set quantities done | ||
|
||
- Validate | ||
|
||
|
||
|
||
However if you are working with packages you will primary operate from the "Packages" menu. | ||
|
||
And it would be much convenient if you could move packages directly from this menu. | ||
|
||
This is what this module is designed for. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Cetmix <https://cetmix.com/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This module simplifies package movement between different warehouse locations. | ||
|
||
You can simply select several packages and use a wizard that will perform all the underlying inventory operations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Only packages residing in the same source location can be moved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- Go to the "Inventory -> Products -> Packages" | ||
|
||
- Open a package or select several packages in the list vies. Important: all selected packages must be located in the same location | ||
|
||
- Open the "Action" menu and select "Move packages" | ||
|
||
- In the opened wizard select the destination location where you want to move the packages | ||
|
||
- You can select an optional destination package in the "Destination Package" field. If selected the content of the selected packages will be moved into the destination package located at the destination location. | ||
|
||
- Click the "Move" button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
stock_quant_package_fast_move.access_stock_quant_package_fast_move_wizard,access_stock_quant_package_fast_move_wizard,stock_quant_package_fast_move.model_stock_quant_package_fast_move_wizard,stock.group_stock_user,1,1,1,1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.