diff --git a/stock_warehouse_orderpoint_stock_info/README.rst b/stock_warehouse_orderpoint_stock_info/README.rst new file mode 100644 index 000000000..90bcd93a2 --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/README.rst @@ -0,0 +1,15 @@ +Reordering Rules stock info +=========================== + +This modules allows to know the product availability directly in the reordering +rules. + + +Credits +======= + +Contributors +------------ +* Oihane Crucelaegui +* Pedro M. Baeza +* Ana Juaristi \ No newline at end of file diff --git a/stock_warehouse_orderpoint_stock_info/__init__.py b/stock_warehouse_orderpoint_stock_info/__init__.py new file mode 100644 index 000000000..054c8853d --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models diff --git a/stock_warehouse_orderpoint_stock_info/__openerp__.py b/stock_warehouse_orderpoint_stock_info/__openerp__.py new file mode 100644 index 000000000..02ecb0528 --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/__openerp__.py @@ -0,0 +1,41 @@ +# -*- 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 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": "Reordering rules stock info", + "version": "1.0", + "depends": [ + "stock", + ], + "author": "OdooMRP team," + "AvanzOSC," + "Serv. Tecnol. Avanzados - Pedro M. Baeza", + "website": "http://www.odoomrp.com", + "contributors": [ + "Oihane Crucelaegui ", + "Pedro M. Baeza ", + "Ana Juaristi " + ], + "category": "Custom Module", + "summary": "", + "data": [ + "views/stock_warehouse_orderpoint_view.xml", + ], + "installable": True, + "auto_install": False, +} diff --git a/stock_warehouse_orderpoint_stock_info/i18n/es.po b/stock_warehouse_orderpoint_stock_info/i18n/es.po new file mode 100644 index 000000000..b88c82083 --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/i18n/es.po @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_warehouse_orderpoint_stock_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-03-04 11:41+0000\n" +"PO-Revision-Date: 2015-03-04 11:41+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_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view +msgid "Availability under minimum" +msgstr "Disponibilidad por debajo del mínimo" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view +msgid "Group By" +msgstr "Agrupar por" + +#. module: stock_warehouse_orderpoint_stock_info +#: field:stock.warehouse.orderpoint,available:0 +msgid "Is enough product available?" +msgstr "Hay producto suficiente?" + +#. module: stock_warehouse_orderpoint_stock_info +#: model:ir.model,name:stock_warehouse_orderpoint_stock_info.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "Regla de inventario mínimo" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_form_view +msgid "Rules" +msgstr "Reglas" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_form_view +msgid "Stock Info" +msgstr "Info. de Stock" + diff --git a/stock_warehouse_orderpoint_stock_info/i18n/stock_warehouse_orderpoint_stock_info.pot b/stock_warehouse_orderpoint_stock_info/i18n/stock_warehouse_orderpoint_stock_info.pot new file mode 100644 index 000000000..afc9dc3c9 --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/i18n/stock_warehouse_orderpoint_stock_info.pot @@ -0,0 +1,47 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_warehouse_orderpoint_stock_info +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-03-04 11:39+0000\n" +"PO-Revision-Date: 2015-03-04 11:39+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_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view +msgid "Availability under minimum" +msgstr "" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_search_view +msgid "Group By" +msgstr "" + +#. module: stock_warehouse_orderpoint_stock_info +#: field:stock.warehouse.orderpoint,available:0 +msgid "Is enough product available?" +msgstr "" + +#. module: stock_warehouse_orderpoint_stock_info +#: model:ir.model,name:stock_warehouse_orderpoint_stock_info.model_stock_warehouse_orderpoint +msgid "Minimum Inventory Rule" +msgstr "" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_form_view +msgid "Rules" +msgstr "" + +#. module: stock_warehouse_orderpoint_stock_info +#: view:stock.warehouse.orderpoint:stock_warehouse_orderpoint_stock_info.stock_warehouse_orderpoint_form_view +msgid "Stock Info" +msgstr "" + diff --git a/stock_warehouse_orderpoint_stock_info/models/__init__.py b/stock_warehouse_orderpoint_stock_info/models/__init__.py new file mode 100644 index 000000000..6c105e92e --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/models/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import stock_warehouse_orderpoint diff --git a/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py b/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py new file mode 100644 index 000000000..6daf3aba0 --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/models/stock_warehouse_orderpoint.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, fields, api + + +class StockWarehouseOrderpoint(models.Model): + _inherit = 'stock.warehouse.orderpoint' + + @api.one + def _product_available_qty(self): + self.product_location_qty = self.product_id.with_context( + location=self.location_id.id + )._product_available()[self.product_id.id]['qty_available'] + + @api.one + @api.depends('product_location_qty', 'product_min_qty') + def _product_available(self): + self.available = self.product_location_qty > self.product_min_qty + + product_location_qty = fields.Float( + string='Quantity On Location', compute='_product_available_qty') + available = fields.Boolean( + string='Is enough product available?', compute='_product_available', + store=True) diff --git a/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml b/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml new file mode 100644 index 000000000..745d129bb --- /dev/null +++ b/stock_warehouse_orderpoint_stock_info/views/stock_warehouse_orderpoint_view.xml @@ -0,0 +1,43 @@ + + + + + stock.warehouse.orderpoint.tree + stock.warehouse.orderpoint + + + + + + + + + + + stock.warehouse.orderpoint.form + stock.warehouse.orderpoint + + + + + + + + + + + + stock.warehouser.orderpoint.search + stock.warehouse.orderpoint + + + + + + + + + +