From b26b66424be2823c751ff29ea5a72e5f7248b321 Mon Sep 17 00:00:00 2001 From: alfredo Date: Wed, 24 Jun 2015 09:00:53 +0200 Subject: [PATCH] [IMP] stock_quant_manual_assign: Delete picking operations to confirm the wizard of "quants Manual" and check availability. --- stock_quant_manual_assign/__init__.py | 20 +-- stock_quant_manual_assign/__openerp__.py | 31 ++--- stock_quant_manual_assign/i18n/es.po | 127 +++++++++++++++++ stock_quant_manual_assign/i18n/fr.po | 126 +++++++++++++++++ stock_quant_manual_assign/i18n/pt_BR.po | 127 +++++++++++++++++ stock_quant_manual_assign/i18n/sl.po | 127 +++++++++++++++++ .../i18n/stock_quant_manual_assign.pot | 128 ++++++++++++++++++ stock_quant_manual_assign/models/__init__.py | 5 + .../models/stock_picking.py | 21 +++ .../views/stock_move_view.xml | 16 ++- stock_quant_manual_assign/wizard/__init__.py | 19 +-- .../wizard/assign_manual_quants.py | 113 ++++++++-------- .../wizard/assign_manual_quants_view.xml | 2 + 13 files changed, 745 insertions(+), 117 deletions(-) create mode 100644 stock_quant_manual_assign/i18n/es.po create mode 100644 stock_quant_manual_assign/i18n/fr.po create mode 100644 stock_quant_manual_assign/i18n/pt_BR.po create mode 100644 stock_quant_manual_assign/i18n/sl.po create mode 100644 stock_quant_manual_assign/i18n/stock_quant_manual_assign.pot create mode 100644 stock_quant_manual_assign/models/__init__.py create mode 100644 stock_quant_manual_assign/models/stock_picking.py diff --git a/stock_quant_manual_assign/__init__.py b/stock_quant_manual_assign/__init__.py index 307ef6e12..c1a24230c 100644 --- a/stock_quant_manual_assign/__init__.py +++ b/stock_quant_manual_assign/__init__.py @@ -1,20 +1,6 @@ - -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# 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/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - +from . import models from . import wizard diff --git a/stock_quant_manual_assign/__openerp__.py b/stock_quant_manual_assign/__openerp__.py index b4decbd6c..58170e7d2 100644 --- a/stock_quant_manual_assign/__openerp__.py +++ b/stock_quant_manual_assign/__openerp__.py @@ -1,27 +1,12 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# 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/. -# -############################################################################## +# -*- coding: utf-8 -*- +# (c) 2015 Mikel Arregi - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html { "name": "Stock - Manual assignment of quants", - "version": "1.0", - "depends": [ - "stock", - ], + "version": "8.0.1.0.0", + "category": "Warehouse Management", + "license": "AGPL-3", "author": "OdooMRP team," "AvanzOSC," "Serv. Tecnol. Avanzados - Pedro M. Baeza", @@ -31,7 +16,9 @@ "Pedro Manuel Baeza Romero " "Mikel Arregi ", ], - "category": "Warehouse Management", + "depends": [ + "stock", + ], "data": [ "wizard/assign_manual_quants_view.xml", "views/stock_move_view.xml", diff --git a/stock_quant_manual_assign/i18n/es.po b/stock_quant_manual_assign/i18n/es.po new file mode 100644 index 000000000..245503c71 --- /dev/null +++ b/stock_quant_manual_assign/i18n/es.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_manual_assign +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-10-09 10:50+0000\n" +"Last-Translator: Pedro M. Baeza \n" +"Language-Team: Spanish (http://www.transifex.com/oca/odoomrp-wip-8-0/language/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Confirm" +msgstr "Confirmar" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_uid:0 +#: field:assign.manual.quants.lines,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_date:0 +#: field:assign.manual.quants.lines,create_date:0 +msgid "Created on" +msgstr "Creado el" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:25 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,id:0 +#: field:assign.manual.quants.lines,id:0 +msgid "ID" +msgstr "ID" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_uid:0 +#: field:assign.manual.quants.lines,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_date:0 +#: field:assign.manual.quants.lines,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_picking_form_view +msgid "Manual Quants" +msgstr "Quants manuales" + +#. module: stock_quant_manual_assign +#: model:ir.actions.act_window,name:stock_quant_manual_assign.assign_manual_quants_action +msgid "Manual quants" +msgstr "Quants manuales" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,assign_wizard:0 +msgid "Move" +msgstr "Mover" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: stock_quant_manual_assign +#: model:ir.model,name:stock_quant_manual_assign.model_stock_picking +msgid "Picking List" +msgstr "Albarán" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,qty:0 +msgid "QTY" +msgstr "Ctd." + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,quant:0 +msgid "Quant" +msgstr "Quant" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:26 +#, python-format +msgid "Quantity is higher than the needed one" +msgstr "La cantidad es mayor que la requerida" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,quants_lines:0 +msgid "Quants" +msgstr "Quants" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,selected:0 +msgid "Select" +msgstr "Seleccionar" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "or" +msgstr "o" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "qty" +msgstr "ctd." diff --git a/stock_quant_manual_assign/i18n/fr.po b/stock_quant_manual_assign/i18n/fr.po new file mode 100644 index 000000000..94d19ddb7 --- /dev/null +++ b/stock_quant_manual_assign/i18n/fr.po @@ -0,0 +1,126 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_manual_assign +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-09-10 16:41+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/odoomrp-wip-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Cancel" +msgstr "Annuler" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Confirm" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_uid:0 +#: field:assign.manual.quants.lines,create_uid:0 +msgid "Created by" +msgstr "Créé par" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_date:0 +#: field:assign.manual.quants.lines,create_date:0 +msgid "Created on" +msgstr "Créé le" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:25 +#, python-format +msgid "Error" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,id:0 field:assign.manual.quants.lines,id:0 +msgid "ID" +msgstr "Id." + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_uid:0 +#: field:assign.manual.quants.lines,write_uid:0 +msgid "Last Updated by" +msgstr "Mis à jour par" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_date:0 +#: field:assign.manual.quants.lines,write_date:0 +msgid "Last Updated on" +msgstr "Mis à jour le" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_picking_form_view +msgid "Manual Quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: model:ir.actions.act_window,name:stock_quant_manual_assign.assign_manual_quants_action +msgid "Manual quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,assign_wizard:0 +msgid "Move" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,name:0 +msgid "Name" +msgstr "" + +#. module: stock_quant_manual_assign +#: model:ir.model,name:stock_quant_manual_assign.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,qty:0 +msgid "QTY" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,quant:0 +msgid "Quant" +msgstr "" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:26 +#, python-format +msgid "Quantity is higher than the needed one" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,quants_lines:0 +msgid "Quants" +msgstr "Quants" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,selected:0 +msgid "Select" +msgstr "" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "or" +msgstr "ou" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "qty" +msgstr "" diff --git a/stock_quant_manual_assign/i18n/pt_BR.po b/stock_quant_manual_assign/i18n/pt_BR.po new file mode 100644 index 000000000..9995e5cef --- /dev/null +++ b/stock_quant_manual_assign/i18n/pt_BR.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_manual_assign +# +# Translators: +# danimaribeiro , 2015 +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-10-09 03:20+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/odoomrp-wip-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Cancel" +msgstr "Cancelar" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Confirm" +msgstr "Confirmar" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_uid:0 +#: field:assign.manual.quants.lines,create_uid:0 +msgid "Created by" +msgstr "Criado por" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_date:0 +#: field:assign.manual.quants.lines,create_date:0 +msgid "Created on" +msgstr "Criado em" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:25 +#, python-format +msgid "Error" +msgstr "Erro" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,id:0 field:assign.manual.quants.lines,id:0 +msgid "ID" +msgstr "ID" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_uid:0 +#: field:assign.manual.quants.lines,write_uid:0 +msgid "Last Updated by" +msgstr "Última atualização por" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_date:0 +#: field:assign.manual.quants.lines,write_date:0 +msgid "Last Updated on" +msgstr "Última atualização em" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_picking_form_view +msgid "Manual Quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: model:ir.actions.act_window,name:stock_quant_manual_assign.assign_manual_quants_action +msgid "Manual quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,assign_wizard:0 +msgid "Move" +msgstr "Movimentações" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,name:0 +msgid "Name" +msgstr "Nome" + +#. module: stock_quant_manual_assign +#: model:ir.model,name:stock_quant_manual_assign.model_stock_picking +msgid "Picking List" +msgstr "Lista de separação" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,qty:0 +msgid "QTY" +msgstr "QTD" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,quant:0 +msgid "Quant" +msgstr "Quant" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:26 +#, python-format +msgid "Quantity is higher than the needed one" +msgstr "Quantidade é maior que o necessário" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,quants_lines:0 +msgid "Quants" +msgstr "Quants" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,selected:0 +msgid "Select" +msgstr "Selecione" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "or" +msgstr "ou" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "qty" +msgstr "qtd" diff --git a/stock_quant_manual_assign/i18n/sl.po b/stock_quant_manual_assign/i18n/sl.po new file mode 100644 index 000000000..92a33a007 --- /dev/null +++ b/stock_quant_manual_assign/i18n/sl.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_manual_assign +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: odoomrp-wip (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-07 10:45+0000\n" +"PO-Revision-Date: 2015-09-20 19:06+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/odoomrp-wip-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Cancel" +msgstr "Preklic" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Confirm" +msgstr "Potrdi" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_uid:0 +#: field:assign.manual.quants.lines,create_uid:0 +msgid "Created by" +msgstr "Ustvaril" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_date:0 +#: field:assign.manual.quants.lines,create_date:0 +msgid "Created on" +msgstr "Ustvarjeno" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:25 +#, python-format +msgid "Error" +msgstr "Napaka" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,id:0 field:assign.manual.quants.lines,id:0 +msgid "ID" +msgstr "ID" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_uid:0 +#: field:assign.manual.quants.lines,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnji posodobil" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_date:0 +#: field:assign.manual.quants.lines,write_date:0 +msgid "Last Updated on" +msgstr "Zadnjič posodobljeno" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_picking_form_view +msgid "Manual Quants" +msgstr "Ročni kvanti" + +#. module: stock_quant_manual_assign +#: model:ir.actions.act_window,name:stock_quant_manual_assign.assign_manual_quants_action +msgid "Manual quants" +msgstr "Ročni kvanti" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,assign_wizard:0 +msgid "Move" +msgstr "Premik" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,name:0 +msgid "Name" +msgstr "Naziv" + +#. module: stock_quant_manual_assign +#: model:ir.model,name:stock_quant_manual_assign.model_stock_picking +msgid "Picking List" +msgstr "Zbirnik" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,qty:0 +msgid "QTY" +msgstr "KOL" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,quant:0 +msgid "Quant" +msgstr "Kvant" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:26 +#, python-format +msgid "Quantity is higher than the needed one" +msgstr "Količina je višja od potrebne" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,quants_lines:0 +msgid "Quants" +msgstr "Kvant" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,selected:0 +msgid "Select" +msgstr "Izbira" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "or" +msgstr "ali" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "qty" +msgstr "kol" diff --git a/stock_quant_manual_assign/i18n/stock_quant_manual_assign.pot b/stock_quant_manual_assign/i18n/stock_quant_manual_assign.pot new file mode 100644 index 000000000..82af0a95c --- /dev/null +++ b/stock_quant_manual_assign/i18n/stock_quant_manual_assign.pot @@ -0,0 +1,128 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_quant_manual_assign +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-10-01 12:46+0000\n" +"PO-Revision-Date: 2015-10-01 12:46+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_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Cancel" +msgstr "" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "Confirm" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_uid:0 +#: field:assign.manual.quants.lines,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,create_date:0 +#: field:assign.manual.quants.lines,create_date:0 +msgid "Created on" +msgstr "" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:21 +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:24 +#, python-format +msgid "Error" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,id:0 +#: field:assign.manual.quants.lines,id:0 +msgid "ID" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_uid:0 +#: field:assign.manual.quants.lines,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,write_date:0 +#: field:assign.manual.quants.lines,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_form_view +#: view:stock.move:stock_quant_manual_assign.stock_move_manual_quants_picking_form_view +msgid "Manual Quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: model:ir.actions.act_window,name:stock_quant_manual_assign.assign_manual_quants_action +msgid "Manual quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,assign_wizard:0 +msgid "Move" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,name:0 +msgid "Name" +msgstr "" + +#. module: stock_quant_manual_assign +#: model:ir.model,name:stock_quant_manual_assign.model_stock_picking +msgid "Picking List" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,qty:0 +msgid "QTY" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,quant:0 +msgid "Quant" +msgstr "" + +#. module: stock_quant_manual_assign +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:22 +#: code:addons/stock_quant_manual_assign/wizard/assign_manual_quants.py:24 +#, python-format +msgid "Quantity is higher than the needed one" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants,quants_lines:0 +msgid "Quants" +msgstr "" + +#. module: stock_quant_manual_assign +#: field:assign.manual.quants.lines,selected:0 +msgid "Select" +msgstr "" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "or" +msgstr "" + +#. module: stock_quant_manual_assign +#: view:assign.manual.quants:stock_quant_manual_assign.assign_manual_quants_form_view +msgid "qty" +msgstr "" + diff --git a/stock_quant_manual_assign/models/__init__.py b/stock_quant_manual_assign/models/__init__.py new file mode 100644 index 000000000..2dbb95a28 --- /dev/null +++ b/stock_quant_manual_assign/models/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## +from . import stock_picking diff --git a/stock_quant_manual_assign/models/stock_picking.py b/stock_quant_manual_assign/models/stock_picking.py new file mode 100644 index 000000000..0a38c6a24 --- /dev/null +++ b/stock_quant_manual_assign/models/stock_picking.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Mikel Arregi - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openerp import api, fields, models + + +class StockPicking(models.Model): + _inherit = 'stock.picking' + + @api.multi + def action_assign(self): + self.mapped('pack_operation_ids').unlink() + return super(StockPicking, self).action_assign() + + +class StockMove(models.Model): + _inherit = 'stock.move' + + picking_type_code = fields.Selection( + related='picking_type_id.code', store=True) diff --git a/stock_quant_manual_assign/views/stock_move_view.xml b/stock_quant_manual_assign/views/stock_move_view.xml index 3fda53a08..9ca960682 100644 --- a/stock_quant_manual_assign/views/stock_move_view.xml +++ b/stock_quant_manual_assign/views/stock_move_view.xml @@ -7,19 +7,29 @@ + + + - + stock.move.form stock.move + + + diff --git a/stock_quant_manual_assign/wizard/__init__.py b/stock_quant_manual_assign/wizard/__init__.py index fa7e09bfa..a7dec37e7 100644 --- a/stock_quant_manual_assign/wizard/__init__.py +++ b/stock_quant_manual_assign/wizard/__init__.py @@ -1,20 +1,5 @@ - -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# -# 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/. -# +# For copyright and license notices, see __openerp__.py file in root directory ############################################################################## - from . import assign_manual_quants diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants.py b/stock_quant_manual_assign/wizard/assign_manual_quants.py index cee50fd03..decb17d05 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants.py +++ b/stock_quant_manual_assign/wizard/assign_manual_quants.py @@ -1,59 +1,48 @@ +# -*- coding: utf-8 -*- +# (c) 2015 Mikel Arregi - AvanzOSC +# (c) 2015 Oihane Crucelaegui - AvanzOSC +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html -# -*- encoding: utf-8 -*- -############################################################################## -# -# 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 fields, models, api, exceptions, _ +from openerp import api, exceptions, fields, models, _ +import openerp.addons.decimal_precision as dp class AssignManualQuants(models.TransientModel): _name = 'assign.manual.quants' + @api.depends('quants_lines') def lines_qty(self): - total_qty = 0 - for line in self.quants_lines: - if line.selected: - total_qty += line.qty - return total_qty + self.lines_qty = sum(self.quants_lines.mapped('qty')) - @api.one + @api.multi @api.constrains('quants_lines') def check_qty(self): - if self.quants_lines: - total_qty = self.lines_qty() - move = self.env['stock.move'].browse(self.env.context['active_id']) - if total_qty > move.product_uom_qty: - raise exceptions.Warning(_('Error'), - _('Quantity is higher' - ' than the needed one')) + for record in self: + if record.quants_lines: + move = self.env['stock.move'].browse( + self.env.context['active_id']) + if record.lines_qty > move.product_uom_qty: + raise exceptions.Warning( + _('Quantity is higher than the needed one')) @api.depends('quants_lines') def get_move_qty(self): move = self.env['stock.move'].browse(self.env.context['active_id']) - self.move_qty = move.product_uom_qty - self.lines_qty() + self.move_qty = move.product_uom_qty - self.lines_qty name = fields.Char(string='Name') - move_qty = fields.Float(string="Remaining qty", compute="get_move_qty") + lines_qty = fields.Float( + string='Reserved qty', compute='lines_qty', + digits=dp.get_precision('Product Unit of Measure')) + move_qty = fields.Float(string='Remaining qty', compute='get_move_qty', + digits=dp.get_precision('Product Unit of Measure')) quants_lines = fields.One2many('assign.manual.quants.lines', 'assign_wizard', string='Quants') @api.multi def assign_quants(self): move = self.env['stock.move'].browse(self.env.context['active_id']) + move.picking_id.mapped('pack_operation_ids').unlink() quants = [] for quant_id in move.reserved_quant_ids.ids: move.write({'reserved_quant_ids': [[3, quant_id]]}) @@ -66,41 +55,49 @@ class AssignManualQuants(models.TransientModel): @api.model def default_get(self, var_fields): + super(AssignManualQuants, self).default_get(var_fields) move = self.env['stock.move'].browse(self.env.context['active_id']) - available_quants_ids = self.env['stock.quant'].search( + available_quants = self.env['stock.quant'].search( ['|', ('location_id', '=', move.location_id.id), ('location_id', 'in', move.location_id.child_ids.ids), ('product_id', '=', move.product_id.id), ('qty', '>', 0), - ('reservation_id', '=', False)]) - available_quants = [{'quant': x.id} for x in available_quants_ids] - available_quants.extend( - {'quant': x.id, - 'selected': True, - 'qty': x.qty - } for x in move.reserved_quant_ids) - return {'quants_lines': available_quants} + '|', ('reservation_id', '=', False), + ('reservation_id', '=', move.id)]) + quants_lines = [{ + 'quant': x.id, + 'selected': x in move.reserved_quant_ids, + 'qty': x.qty if x in move.reserved_quant_ids else 0, + 'location_id': x.location_id.id, + } for x in available_quants] + return {'quants_lines': quants_lines} class AssignManualQuantsLines(models.TransientModel): _name = 'assign.manual.quants.lines' _rec_name = 'quant' + @api.multi @api.onchange('selected') def onchange_selected(self): - if not self.selected: - self.qty = False - if self.selected and self.qty == 0: - quant_qty = self.quant.qty - remaining_qty = self.assign_wizard.move_qty - if quant_qty < remaining_qty: - self.qty = quant_qty - else: - self.qty = remaining_qty + for record in self: + if not record.selected: + record.qty = False + elif not record.qty: + quant_qty = record.quant.qty + remaining_qty = record.assign_wizard.move_qty + record.qty = (quant_qty if quant_qty < remaining_qty else + remaining_qty) - assign_wizard = fields.Many2one('assign.manual.quants', string='Move', - required=True, ondelete="cascade") - quant = fields.Many2one('stock.quant', string="Quant", required=True, - ondelete='cascade') - qty = fields.Float(string='QTY') - selected = fields.Boolean(string="Select") + assign_wizard = fields.Many2one( + comodel_name='assign.manual.quants', string='Move', required=True, + ondelete='cascade') + quant = fields.Many2one( + comodel_name='stock.quant', string='Quant', required=True, + ondelete='cascade') + location_id = fields.Many2one( + comodel_name='stock.location', string='Location', + related='quant.location_id', readonly=True) + qty = fields.Float( + string='QTY', digits=dp.get_precision('Product Unit of Measure')) + selected = fields.Boolean(string='Select') diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml b/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml index c634bb57e..141ce934a 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml +++ b/stock_quant_manual_assign/wizard/assign_manual_quants_view.xml @@ -10,11 +10,13 @@ +
+