Skip to content

Commit

Permalink
Merge pull request #3 from akretion/8.0-add-stock-packaging-usability
Browse files Browse the repository at this point in the history
Add modules stock_packaging_usability and stock_packaging_usability_ul
  • Loading branch information
sebastienbeau committed May 5, 2015
2 parents 39cc916 + d8f895d commit 9c5b9cd
Show file tree
Hide file tree
Showing 17 changed files with 796 additions and 0 deletions.
38 changes: 38 additions & 0 deletions stock_packaging_usability/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Stock Packaging Usability
=========================

Usage
=====

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 !

Credits
=======

Contributors
------------

* Alexis de Lattre <alexis.delattre@akretion.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit http://odoo-community.org.
23 changes: 23 additions & 0 deletions stock_packaging_usability/__init__.py
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
34 changes: 34 additions & 0 deletions stock_packaging_usability/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# -*- 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",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['stock'],
'data': ['wizard/stock_transfer_details.xml'],
'installable': True,
}
64 changes: 64 additions & 0 deletions stock_packaging_usability/i18n/fr.po
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 "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 stock_packaging_usability/i18n/stock_packaging_usability.pot
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 ""

23 changes: 23 additions & 0 deletions stock_packaging_usability/wizard/__init__.py
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 stock_packaging_usability/wizard/stock_transfer_details.py
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 stock_packaging_usability/wizard/stock_transfer_details.xml
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>
32 changes: 32 additions & 0 deletions stock_packaging_usability_ul/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Stock Packaging Usability UL
============================

Usage
=====

This module modifies the behavior of the buttons *Put in new pack*
(native button) and *Put residual in one pack* (provided by the module
*stock_packing_usability*) of the *Transfer* wizard : when you clicks
on those buttons, it will ask you to select the logistical unit (object
*product.ul*) of the package.

Credits
=======

Contributors
------------

* Alexis de Lattre <alexis.delattre@akretion.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit http://odoo-community.org.
Loading

0 comments on commit 9c5b9cd

Please sign in to comment.