-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add modules stock_packaging_usability and stock_packaging_usability_ul
- Loading branch information
Alexis de Lattre
committed
Nov 21, 2014
1 parent
c2369a3
commit d4e60a7
Showing
15 changed files
with
731 additions
and
0 deletions.
There are no files selected for viewing
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,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Stock Packaging Usability module for Odoo | ||
# Copyright (C) 2014 Akretion (http://www.akretion.com) | ||
# @author Alexis de Lattre <alexis.delattre@akretion.com> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
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,50 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Stock Packaging Usability module for Odoo | ||
# Copyright (C) 2014 Akretion (http://www.akretion.com). | ||
# @author Alexis de Lattre <alexis.delattre@akretion.com> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
{ | ||
'name': 'Stock Packaging Usability', | ||
'version': '1.0', | ||
'category': 'Warehouse Management', | ||
'license': 'AGPL-3', | ||
'summary': "Faster packaging process in Odoo", | ||
'description': """ | ||
This module adds 2 buttons in the *Transfer* wizard of the picking: | ||
* *Put in current pack* (this button is native in v7 but not in v8) | ||
* *Put residual in new pack* : all the lines that are not in a package | ||
will be put in a new package. | ||
So this module is a time saver when you use the packaging features of Odoo ! | ||
For example, on a picking where all the products go in the same package, you | ||
just have to click on the button *Put residual in new pack* and you're done: | ||
no need to click on each line ! | ||
This module has been written by Alexis de Lattre from Akretion | ||
<alexis.delattre@akretion.com> | ||
""", | ||
'author': 'Akretion', | ||
'website': 'http://www.akretion.com', | ||
'depends': ['stock'], | ||
'data': ['wizard/stock_transfer_details.xml'], | ||
'installable': 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,64 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_packaging_usability | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2014-11-21 08:57+0000\n" | ||
"PO-Revision-Date: 2014-11-21 08:57+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_packaging_usability | ||
#: model:ir.model,name:stock_packaging_usability.model_stock_transfer_details | ||
msgid "Picking wizard" | ||
msgstr "Picking wizard" | ||
|
||
#. module: stock_packaging_usability | ||
#: model:ir.model,name:stock_packaging_usability.model_stock_transfer_details_items | ||
msgid "Picking wizard items" | ||
msgstr "Picking wizard items" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Products To Move" | ||
msgstr "Produits à déplacer" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put Residual in New Pack" | ||
msgstr "Mettre le reste dans un nouveau paquet" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put in current pack" | ||
msgstr "Mettre dans le paquet actuel" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put in new pack" | ||
msgstr "Mettre dans un nouveau paquet" | ||
|
||
#. module: stock_packaging_usability | ||
#: code:addons/stock_packaging_usability/wizard/stock_transfer_details.py:58 | ||
#, python-format | ||
msgid "There is no current package" | ||
msgstr "Il n'y a pas de paquet actuel" | ||
|
||
#. module: stock_packaging_usability | ||
#: code:addons/stock_packaging_usability/wizard/stock_transfer_details.py:52 | ||
#, python-format | ||
msgid "This product is already in a package !" | ||
msgstr "Ce produit est déjà dans un paquet !" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "terp-accessories-archiver+" | ||
msgstr "terp-accessories-archiver+" | ||
|
64 changes: 64 additions & 0 deletions
64
stock_packaging_usability/i18n/stock_packaging_usability.pot
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,64 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * stock_packaging_usability | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 8.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2014-11-21 08:57+0000\n" | ||
"PO-Revision-Date: 2014-11-21 08:57+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_packaging_usability | ||
#: model:ir.model,name:stock_packaging_usability.model_stock_transfer_details | ||
msgid "Picking wizard" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: model:ir.model,name:stock_packaging_usability.model_stock_transfer_details_items | ||
msgid "Picking wizard items" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Products To Move" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put Residual in New Pack" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put in current pack" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "Put in new pack" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: code:addons/stock_packaging_usability/wizard/stock_transfer_details.py:58 | ||
#, python-format | ||
msgid "There is no current package" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: code:addons/stock_packaging_usability/wizard/stock_transfer_details.py:52 | ||
#, python-format | ||
msgid "This product is already in a package !" | ||
msgstr "" | ||
|
||
#. module: stock_packaging_usability | ||
#: view:stock.transfer_details:stock_packaging_usability.view_stock_enter_transfer_details | ||
msgid "terp-accessories-archiver+" | ||
msgstr "" | ||
|
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,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Stock Packaging Usability module for Odoo | ||
# Copyright (C) 2014 Akretion (http://www.akretion.com) | ||
# @author Alexis de Lattre <alexis.delattre@akretion.com> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from . import stock_transfer_details |
62 changes: 62 additions & 0 deletions
62
stock_packaging_usability/wizard/stock_transfer_details.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,62 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Stock Packaging Usability module for Odoo | ||
# Copyright (C) 2014 Akretion (http://www.akretion.com) | ||
# @author Alexis de Lattre <alexis.delattre@akretion.com> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from openerp import models, api, _ | ||
from openerp.exceptions import Warning | ||
|
||
|
||
class StockTransferDetails(models.TransientModel): | ||
_inherit = 'stock.transfer_details' | ||
|
||
@api.multi | ||
def put_residual_in_new_pack(self): | ||
for wiz in self: | ||
items_to_update = wiz.item_ids | ||
for item in wiz.item_ids: | ||
if item.result_package_id: | ||
items_to_update -= item | ||
if not item.quantity: | ||
items_to_update -= item | ||
items_to_update.put_in_pack() | ||
if self and self[0]: | ||
return self[0].wizard_view() | ||
|
||
|
||
class StockTransferDetailsItems(models.TransientModel): | ||
_inherit = 'stock.transfer_details_items' | ||
|
||
@api.multi | ||
def put_in_last_pack(self): | ||
for packop in self: | ||
if packop.result_package_id: | ||
raise Warning( | ||
_('This product is already in a package !')) | ||
all_cur_packs_ids = [ | ||
packop2.result_package_id.id for packop2 | ||
in self.transfer_id.item_ids if packop2.result_package_id] | ||
if not all_cur_packs_ids: | ||
raise Warning( | ||
_('There is no current package')) | ||
all_cur_packs_ids.sort() | ||
packop.result_package_id = all_cur_packs_ids[-1] | ||
if self and self[0]: | ||
return self[0].transfer_id.wizard_view() |
41 changes: 41 additions & 0 deletions
41
stock_packaging_usability/wizard/stock_transfer_details.xml
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,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- | ||
Copyright (C) 2014 Akretion (http://www.akretion.com/) | ||
@author Alexis de Lattre <alexis.delattre@akretion.com> | ||
The licence is in the file __openerp__.py | ||
--> | ||
|
||
<openerp> | ||
<data> | ||
|
||
|
||
<record id="view_stock_enter_transfer_details" model="ir.ui.view"> | ||
<field name="name">stock_packaging_usability.stock.transfer_details</field> | ||
<field name="model">stock.transfer_details</field> | ||
<field name="inherit_id" ref="stock.view_stock_enter_transfer_details" /> | ||
<field name="arch" type="xml"> | ||
<group string="Products To Move" position="inside"> | ||
<button type="object" name="put_residual_in_new_pack" | ||
string="Put Residual in New Pack" | ||
groups="stock.group_tracking_lot"/> | ||
</group> | ||
<button name="put_in_pack" type="object" position="before"> | ||
<button name="put_in_last_pack" type="object" | ||
string="Put in current pack" | ||
icon="terp-accessories-archiver" | ||
groups="stock.group_tracking_lot" | ||
attrs="{'invisible': [('result_package_id', '!=', False)]}"/> | ||
</button> | ||
<button name="put_in_pack" type="object" position="attributes"> | ||
<attribute name="string">Put in new pack</attribute> | ||
</button> | ||
<button name="put_in_pack" type="object" position="attributes"> | ||
<attribute name="icon">terp-accessories-archiver+</attribute> | ||
</button> | ||
</field> | ||
</record> | ||
|
||
|
||
</data> | ||
</openerp> |
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,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Stock Packaging Usability UL module for Odoo | ||
# Copyright (C) 2014 Akretion (http://www.akretion.com) | ||
# @author Alexis de Lattre <alexis.delattre@akretion.com> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from . import wizard |
Oops, something went wrong.