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

11.0 mig stock move location WIP #522

Closed
wants to merge 10 commits into from
21 changes: 21 additions & 0 deletions stock_move_location/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
**This file is going to be generated by oca-gen-addon-readme.**

*Manual changes will be overwritten.*

Please provide content in the ``readme`` directory:

* **DESCRIPTION.rst** (required)
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)

Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.

A good, one sentence summary in the manifest is also highly recommended.
6 changes: 6 additions & 0 deletions stock_move_location/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import wizard
from . import models
21 changes: 21 additions & 0 deletions stock_move_location/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

{
"name": "Move Stock Location",
"version": "11.0.1.0.0",
"author": "Julius Network Solutions, "
"Odoo Community Association (OCA)",
"summary": "This module allows to move all stock "
"in a stock location to an other one.",
"website": "https://github.com/OCA/stock-logistics-warehouse",
'license': 'AGPL-3',
"depends": [
"stock",
],
"category": "Stock",
"data": [
'wizard/stock_move_location.xml',
],
}
168 changes: 168 additions & 0 deletions stock_move_location/i18n/stock_move_location.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_move_location
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-01-08 23:43+0000\n"
"PO-Revision-Date: 2019-01-08 23:43+0000\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_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "Add all"
msgstr ""

#. module: stock_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "Cancel"
msgstr ""

#. module: stock_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "Clear all"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_create_uid
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_create_uid
msgid "Created by"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_create_date
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_create_date
msgid "Created on"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_destination_location_id
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_destination_location_id
msgid "Destination Location"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_display_name
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_display_name
msgid "Display Name"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_id
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_id
msgid "ID"
msgstr ""

#. module: stock_move_location
#: model:ir.model,name:stock_move_location.model_stock_inventory
msgid "Inventory"
msgstr ""

#. module: stock_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "Inventory Details"
msgstr ""

#. module: stock_move_location
#: model:ir.model,name:stock_move_location.model_stock_inventory_line
msgid "Inventory Line"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location___last_update
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line___last_update
msgid "Last Modified on"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_write_uid
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_write_uid
msgid "Last Updated by"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_write_date
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_write_date
msgid "Last Updated on"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_lot_id
msgid "Lot/Serial Number"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_max_quantity
msgid "Maximum available quantity"
msgstr ""

#. module: stock_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "Move Location"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_stock_move_location_line_ids
msgid "Move Location lines"
msgstr ""

#. module: stock_move_location
#: model:ir.actions.act_window,name:stock_move_location.wiz_stock_move_location_action
#: model:ir.ui.menu,name:stock_move_location.menuitem_move_location
msgid "Move from location..."
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_move_location_wizard_id
msgid "Move location Wizard"
msgstr ""

#. module: stock_move_location
#: code:addons/stock_move_location/wizard/stock_move_location_line.py:56
#, python-format
msgid "Move quantity can not exceed max quantity or be negative"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_origin_location_id
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_origin_location_id
msgid "Origin Location"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_product_id
msgid "Product"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_product_uom_id
msgid "Product Unit of Measure"
msgstr ""

#. module: stock_move_location
#: model:ir.model.fields,field_description:stock_move_location.field_wiz_stock_move_location_line_move_quantity
msgid "Quantity to move"
msgstr ""

#. module: stock_move_location
#: model:ir.ui.view,arch_db:stock_move_location.view_wiz_stock_move_location_form_stock_move_location
msgid "UoM"
msgstr ""

#. module: stock_move_location
#: model:ir.model,name:stock_move_location.model_wiz_stock_move_location
msgid "wiz.stock.move.location"
msgstr ""

#. module: stock_move_location
#: model:ir.model,name:stock_move_location.model_wiz_stock_move_location_line
msgid "wiz.stock.move.location.line"
msgstr ""

4 changes: 4 additions & 0 deletions stock_move_location/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import stock_move
20 changes: 20 additions & 0 deletions stock_move_location/models/stock_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo import api, fields, models


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

location_move = fields.Boolean(
string="Part of move location",
help="Wether this move is a part of stock_location moves",
)

@api.depends("location_move")
def _compute_show_details_visible(self):
super()._compute_show_details_visible()
for move in self:
if move.location_move:
move.show_details_visible = True
2 changes: 2 additions & 0 deletions stock_move_location/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* Mathieu Vatel <mathieu@julius.fr>
* Mykhailo Panarin <m.panarin@mobilunity.com>
1 change: 1 addition & 0 deletions stock_move_location/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allows to move entire location of products from one place to another
10 changes: 10 additions & 0 deletions stock_move_location/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
* A new menuitem Stock > Move from location... opens a wizard
where 2 location ca be specified.
* Select origin and destination locations and press "IMMEDIATE TRANSFER" or "PLANNED TRANSFER"
* Press `ADD ALL` button to add all products available
* Those lines can be edited. Move quantity can't be more than a max available quantity
* Move doesn't care about the reservations and will move stuff anyway
* If during you operation with the wizard the real quantity will change
it will move only the available quantity at the button press
* Products will be moved and a form view of picking that did that will show up
* If "PLANNED TRANSFER" is used - the picking won't be validated automatically
6 changes: 6 additions & 0 deletions stock_move_location/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from . import test_common
from . import test_move_location
93 changes: 93 additions & 0 deletions stock_move_location/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Copyright (C) 2011 Julius Network Solutions SARL <contact@julius.fr>
# Copyright 2018 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)

from odoo.tests import common


class TestsCommon(common.SavepointCase):

@classmethod
def setUpClass(cls):
super().setUpClass()
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.location_obj = cls.env["stock.location"]
mpanarin marked this conversation as resolved.
Show resolved Hide resolved
product_obj = cls.env["product.product"]
cls.wizard_obj = cls.env["wiz.stock.move.location"]
cls.quant_obj = cls.env["stock.quant"]

cls.internal_loc_1 = cls.location_obj.create({
"name": "INT_1",
"usage": "internal",
"active": True,
})
cls.internal_loc_2 = cls.location_obj.create({
"name": "INT_2",
"usage": "internal",
"active": True,
})
cls.uom_unit = cls.env.ref('product.product_uom_unit')
cls.product_no_lots = product_obj.create({
"name": "Pineapple",
"type": "product",
"tracking": "none",
'categ_id': cls.env.ref('product.product_category_all').id,
})
cls.product_lots = product_obj.create({
"name": "Pineapple",
"type": "product",
"tracking": "lot",
'categ_id': cls.env.ref('product.product_category_all').id,
})
cls.lot1 = cls.env['stock.production.lot'].create({
'product_id': cls.product_lots.id,
})
cls.lot2 = cls.env['stock.production.lot'].create({
'product_id': cls.product_lots.id,
})
cls.lot3 = cls.env['stock.production.lot'].create({
'product_id': cls.product_lots.id,
})

def setup_product_amounts(self):
self.set_product_amount(
self.product_no_lots,
self.internal_loc_1,
123,
)
self.set_product_amount(
self.product_lots,
self.internal_loc_1,
1,
lot_id=self.lot1,
)
self.set_product_amount(
self.product_lots,
self.internal_loc_1,
1,
lot_id=self.lot2,
)
self.set_product_amount(
self.product_lots,
self.internal_loc_1,
1,
lot_id=self.lot3,
)

def set_product_amount(self, product, location, amount, lot_id=None):
self.env['stock.quant']._update_available_quantity(
product,
location,
amount,
lot_id=lot_id,
)

def check_product_amount(self, product, location, amount, lot_id=None):
self.assertEqual(
self.env['stock.quant']._get_available_quantity(
product,
location,
lot_id=lot_id,
),
amount,
)
Loading