Ver código fonte

Mostrar un mensaje que el producto no cuenta con stock

SEBAS 2 anos atrás
commit
3f4373f7c7

+ 75 - 0
README.rst

@@ -0,0 +1,75 @@
+.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
+   :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
+   :alt: License: AGPL-3
+
+=======================
+Stock Check No Negative
+=======================
+
+This module extends warehouse functionalities to not reach below zero in product available quantities
+
+Installation
+============
+
+Just select it from available modules to install it, there is no need to extra installations
+
+Configuration
+=============
+
+This module brings product configurations per products as the following,
+
+* Go to Products > Products, in the Inventory tab is now allowed to select an option
+  called "**Check no negative**" to activate this module main functionality
+
+Usage
+=====
+
+* Before doing a transfer this will check availability for every single product (with the option mentioned before marked) within the transfer
+
+.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
+   :alt: Try me on Runbot
+   :target: https://runbot.odoo-community.org/runbot/154/8.0
+
+.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
+.. branch is "8.0" for example
+
+Known issues / Roadmap
+======================
+
+* TODO in method check_before_action_done: stock_move use product_uom
+
+Bug Tracker
+===========
+
+Bugs are tracked on `GitHub Issues <https://github.com/OCA/
+stock-logistics-workflow/issues>`_.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/
+stock-logistics-workflow/issues/new?body=module:%20
+stock_no_negative%0Aversion:%20
+8.0.1.0.10A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
+
+
+Credits
+=======
+
+Contributors
+------------
+
+* Moises Lopez <moylop260@vauxoo.com>
+* Osval Reyes <osval@vauxoo.com>
+
+Maintainer
+----------
+
+.. image:: https://odoo-community.org/logo.png
+   :alt: Odoo Community Association
+   :target: https://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.

+ 21 - 0
__init__.py

@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2015 Vauxoo
+#    Author: Luis Torres, Osval Reyes
+#
+#    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 models

BIN
__init__.pyc


+ 36 - 0
__openerp__.py

@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2015 Vauxoo
+#    Author: Luis Torres, Osval Reyes
+#
+#    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 Check No Negative",
+    "version": "8.0.1.0.1",
+    "author": "Vauxoo,Odoo Community Association (OCA)",
+    "category": "Generic Modules",
+    "website": "http://www.vauxoo.com",
+    "license": "AGPL-3",
+    "depends": [
+        "stock"
+    ],
+    "data": [
+        "views/product_template.xml"
+    ],
+    "installable": True,
+    "auto_install": False
+}

+ 57 - 0
i18n/ca.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-01-14 08:48+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Catalan (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/ca/)\n"
+"Language: ca\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Plantilla del producte"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Moure l'estoc"

+ 64 - 0
i18n/de.po

@@ -0,0 +1,64 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+# Rudolf Schnapka <rs@techno-flex.de>, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-08-16 02:39+0000\n"
+"PO-Revision-Date: 2016-01-18 19:45+0000\n"
+"Last-Translator: Rudolf Schnapka <rs@techno-flex.de>\n"
+"Language-Team: German (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/de/)\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr "mit der Los-/Seriennummer '%s'"
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr "Erlaube keine negativen"
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+"Ist dieses Feld gesetzt, kann keine negative Bestandbuchung auf internen "
+"Quellort getätigt werden"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+"Product '%s' hat aktive Option 'keine neg. Bestände' \n"
+"aber nach dieser Buchung hätten Sie eine Menge von '%s' \n"
+"%s am Lagerort\n"
+"'%s'"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Produktvorlage"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Lagerbuchung"

+ 57 - 0
i18n/es.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-04-24 02:43+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Spanish (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/es/)\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Plantilla de producto"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimiento de existencias"

+ 57 - 0
i18n/es_AR.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-05-31 02:51+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Spanish (Argentina) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/es_AR/)\n"
+"Language: es_AR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimiento de stock"

+ 57 - 0
i18n/es_MX.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-03 06:09+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Spanish (Mexico) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/es_MX/)\n"
+"Language: es_MX\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Plantilla del producto"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimiento bursátil"

+ 57 - 0
i18n/fi.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-18 01:44+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Finnish (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/fi/)\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Tuotteen malli"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Varastosiirto"

+ 64 - 0
i18n/fr.po

@@ -0,0 +1,64 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+# Hosni Hadj Taher <hajhasni@hotmail.com>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-02-18 08:44+0000\n"
+"PO-Revision-Date: 2017-02-21 17:47+0000\n"
+"Last-Translator: Hosni Hadj Taher <hajhasni@hotmail.com>\n"
+"Language-Team: French (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/fr/)\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr "Avec le lot / série '%s'"
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr "Vérifier pas de négatif"
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+"Si ce champ est Vrai, il est impossible de déplacer ce produit en quantité "
+"négative disponible dans la source de localisation interne"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+"Le produit '%s' a activé 'vérifier pas de négatif'\n"
+"mais avec ce mouvement vous aurez une quantité de '%s'\n"
+"%sin emplacement\n"
+"'%s'"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Modèle d'article"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Mouvement de stock"

+ 57 - 0
i18n/fr_CH.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-29 18:56+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: French (Switzerland) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/fr_CH/)\n"
+"Language: fr_CH\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Template de produit"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""

+ 58 - 0
i18n/hr.po

@@ -0,0 +1,58 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-11-18 01:44+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Croatian (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/hr/)\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Predložak proizvoda"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Skladišni prenos"

+ 58 - 0
i18n/hr_HR.po

@@ -0,0 +1,58 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-19 11:08+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Croatian (Croatia) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/hr_HR/)\n"
+"Language: hr_HR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Predložak proizvoda"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""

+ 57 - 0
i18n/it.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-05-22 18:05+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Italian (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/it/)\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Template Prodotto"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimento di magazzino"

+ 57 - 0
i18n/pt.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-01-07 07:49+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Portuguese (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/pt/)\n"
+"Language: pt\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimento Stock"

+ 57 - 0
i18n/pt_BR.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-19 11:08+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/pt_BR/)\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Modelo Produto"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Movimentação de estoque"

+ 58 - 0
i18n/ro.po

@@ -0,0 +1,58 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-19 11:08+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Romanian (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/ro/)\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?"
+"2:1));\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Produs șablon"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""

+ 66 - 0
i18n/sl.po

@@ -0,0 +1,66 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+# Matjaž Mozetič <m.mozetic@matmoz.si>, 2015-2016
+# Paolo Valier, 2016
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-08-16 02:39+0000\n"
+"PO-Revision-Date: 2015-10-22 04:07+0000\n"
+"Last-Translator: Matjaž Mozetič <m.mozetic@matmoz.si>\n"
+"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/sl/)\n"
+"Language: sl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \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_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr "z lotom/serijsko št. '%s'"
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr "Preveri ne negativne"
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+"Če je to polje označeno kot 'pravilno', se tega proizvoda z negativno "
+"razpoložljivo količino na interni izvorni lokaciji ne more premikati"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+"Proizvod '%s' ima aktivno 'Preveri ne negativne', \n"
+"a bi s tem premikom imeli količino '%s' \n"
+"%sna lokaciji\n"
+"'%s'"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Predloga proizvoda"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Premik zaloge"

+ 50 - 0
i18n/stock_no_negative.pot

@@ -0,0 +1,50 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+#	* stock_no_negative
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 8.0\n"
+"Report-Msgid-Bugs-To: \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_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid "If this field is True can not move this product in negative quantity available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid "Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""
+

+ 58 - 0
i18n/tr.po

@@ -0,0 +1,58 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+# Ahmet Altinisik <aaltinisik@altinkaya.com.tr>, 2017
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-01-14 08:48+0000\n"
+"PO-Revision-Date: 2017-01-16 19:30+0000\n"
+"Last-Translator: Ahmet Altinisik <aaltinisik@altinkaya.com.tr>\n"
+"Language-Team: Turkish (http://www.transifex.com/oca/OCA-stock-logistics-"
+"workflow-8-0/language/tr/)\n"
+"Language: tr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Stok hareketi"

+ 57 - 0
i18n/tr_TR.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2016-12-31 09:53+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Turkish (Turkey) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/tr_TR/)\n"
+"Language: tr_TR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Ürün şablonu"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr "Stok hareketi"

+ 57 - 0
i18n/vi_VN.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-19 11:08+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Vietnamese (Viet Nam) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/vi_VN/)\n"
+"Language: vi_VN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "Mẫu sản phẩm"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""

+ 57 - 0
i18n/zh_CN.po

@@ -0,0 +1,57 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_no_negative
+#
+# Translators:
+msgid ""
+msgstr ""
+"Project-Id-Version: stock-logistics-workflow (8.0)\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2017-08-19 11:08+0000\n"
+"PO-Revision-Date: 2015-10-21 16:33+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-stock-"
+"logistics-workflow-8-0/language/zh_CN/)\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:162
+#, python-format
+msgid " with the lot/serial '%s' "
+msgstr ""
+
+#. module: stock_no_negative
+#: field:product.template,check_no_negative:0
+msgid "Check no negative"
+msgstr ""
+
+#. module: stock_no_negative
+#: help:product.template,check_no_negative:0
+msgid ""
+"If this field is True can not move this product in negative quantity "
+"available in the internal location source"
+msgstr ""
+
+#. module: stock_no_negative
+#: code:addons/stock_no_negative/models/stock_move.py:165
+#, python-format
+msgid ""
+"Product '%s' has active 'check no negative' \n"
+"but with this move you will have a quantity of '%s' \n"
+"%sin location \n"
+"'%s'"
+msgstr ""
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_product_template
+msgid "Product Template"
+msgstr "产品模板"
+
+#. module: stock_no_negative
+#: model:ir.model,name:stock_no_negative.model_stock_move
+msgid "Stock Move"
+msgstr ""

+ 23 - 0
models/__init__.py

@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2015 Vauxoo
+#    Author: Luis Torres, Osval Reyes
+#
+#    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 product_template
+from . import stock_move

BIN
models/__init__.pyc


+ 31 - 0
models/product_template.py

@@ -0,0 +1,31 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2015 Vauxoo
+#    Author: Luis Torres, Osval Reyes
+#
+#    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
+
+
+class ProductTemplate(models.Model):
+    _inherit = 'product.template'
+
+    check_no_negative = fields.Boolean(
+        'Check no negative',
+        help='If this field is True can not move this'
+             ' product in negative quantity available in'
+             ' the internal location source')

BIN
models/product_template.pyc


+ 175 - 0
models/stock_move.py

@@ -0,0 +1,175 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright 2015 Vauxoo
+#    Author: Luis Torres, Osval Reyes
+#
+#    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 _, exceptions, models
+
+
+class StockMove(models.Model):
+    _inherit = 'stock.move'
+
+    def get_operations_as_action_done(self, cr, uid, ids,
+                                      context=None):
+        """Get stock.pack.operation from stock move
+        Copied from 'action_done' original method
+
+        I don't know if use directly move.linked_move_operation_ids
+        or move.pack_operation_ids is a good idea.
+        But I prefer use native extract data.
+        Move don't exists 'lot_id', then this is necessary to get it
+        """
+
+        # Search operations that are linked to the moves
+        operations = set()
+        for move in self.browse(cr, uid, ids, context=context):
+            for link in move.linked_move_operation_ids:
+                operations.add(link.operation_id)
+
+        # Sort operations according to entire packages first,
+        # then package + lot, package only, lot only
+        operations = list(operations)
+        # This part not is necessary
+        # operations.sort(key=lambda x: (
+        #    (x.package_id and not x.product_id) and -4 or 0) \
+        #    + (x.package_id and -2 or 0) + (x.lot_id and -1 or 0))
+        return operations
+
+    def check_after_action_done(self, cr, uid, operation_or_move,
+                                context=None):
+        """
+        Method to check operation or move plus lot_id
+        easiest inherit cases after action done
+        """
+        return True
+
+    def check_before_action_done(self, cr, uid, operation_or_move,
+                                 context=None):
+        """
+        Method to check operation or move plus lot_id
+        easiest inherit cases before action done
+        """
+        self.check_before_done_no_negative(
+            cr, uid, operation_or_move.product_id.id,
+            operation_or_move.product_uom_id.id,
+            operation_or_move.product_qty,
+            operation_or_move.location_id.id,
+            lot_id=operation_or_move.lot_id.id,
+            context=context)
+        return True
+
+    def action_done(self, cr, uid, ids, context=None):
+        """
+        Method to enable check operation or move
+
+        We need this check after of process move to get
+        real quantity after of this moves and we need this check
+        before of process move to validate with no real quantity
+        """
+        # operations before done
+        operations_before_done = self.get_operations_as_action_done(
+            cr, uid, ids, context=context)
+
+        for operation in operations_before_done:
+
+            self.check_before_action_done(
+                cr, uid, operation, context=context)
+
+        res = super(StockMove, self).action_done(
+            cr, uid, ids, context=context)
+
+        # operations after done
+        operations_after_done = self.get_operations_as_action_done(
+            cr, uid, ids, context=context)
+
+        for operation in operations_after_done:
+            self.check_after_action_done(
+                cr, uid, operation, context=context)
+        return res
+
+    def check_before_done_no_negative(
+            self, cr, uid,
+            product_id, product_uom, product_qty,
+            location_id, lot_id=None,
+            context=None):
+        """
+        Check quantity no negative from a location.
+        if product has active check_no_negative and
+        location is internal
+        Use lot_id if exists to get quantity available
+        @param self: The object pointer.
+        @param cr: A database cursor
+        @param uid: ID of the user currently logged in
+        @param product_id: integer with product.product to check
+        @param location_id: integer with stock.location to check
+        @param lot_id: optional integer with
+                       stock.production.lot to check
+        @param context: A standard dictionary
+        @return: True if quantity available >= 0
+                 triggers an exception if quantity available <0
+        """
+        product_pool = self.pool.get('product.product')
+        location_pool = self.pool.get('stock.location')
+        lot_pool = self.pool.get('stock.production.lot')
+        product_uom_obj = self.pool.get('product.uom')
+        product_data = product_pool.read(
+            cr, uid,
+            [product_id], ['name', 'check_no_negative', 'uom_id'],
+            context=context)[0]
+        if product_data['check_no_negative']:
+            location_data = location_pool.read(
+                cr, uid, [location_id],
+                ['complete_name', 'usage'],
+                context=context)[0]
+            if location_data['usage'] == 'internal':
+                ctx = context.copy()
+                ctx.update({
+                    'lot_id': lot_id,
+                    'location': location_id,
+                    'compute_child': True,
+                })
+                qty_available_before_done = product_pool.read(
+                    cr, uid,
+                    [product_id], ['qty_available'],
+                    context=ctx)[0]['qty_available']
+                default_uom_id = product_data['uom_id'][0]
+                qty_computed = product_uom_obj._compute_qty(
+                    cr, uid, product_uom, product_qty, default_uom_id)
+                qty_available_after_done = \
+                    qty_available_before_done - qty_computed
+                if qty_available_after_done < 0:
+                    lot_msg_str = ""
+                    if lot_id:
+                        lot_data = lot_pool.read(
+                            cr, uid,
+                            [lot_id], ['name'],
+                            context=context)[0]
+                        lot_msg_str = _(
+                            " with the lot/serial '%s' "
+                        ) % lot_data['name']
+                    raise exceptions.ValidationError(_(
+                        "Product '%s' has active "
+                        "'check no negative' \n"
+                        "but with this move "
+                        "you will have a quantity of "
+                        "'%s' \n%sin location \n'%s'"
+                    ) % (product_data['name'],
+                         qty_available_after_done,
+                         lot_msg_str,
+                         location_data['complete_name'],))
+        return True

BIN
models/stock_move.pyc


BIN
static/description/icon.png


+ 15 - 0
views/product_template.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_product_no_negative_form" model="ir.ui.view">
+            <field name="name">view.product.no.negative.form</field>
+            <field name="model">product.template</field>
+            <field name="inherit_id" ref="stock.view_template_property_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='virtual_available']" position="after">
+                    <field name='check_no_negative'/>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>