-
-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[7.0] quantity warning on lot with negative number #45
Changes from all commits
b4c8ebd
1c0285e
8186c14
6c69b66
0aa87fb
c952e2f
e758e3c
9721da6
24dd66d
26a604d
3e0adc8
d971613
7596a0b
5137b3b
c8c7702
dd80cb5
9195d17
f95a895
fda31b9
35f1a8e
0f43908
9798b45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
sudo: required | ||
language: python | ||
|
||
python: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
{ | ||
'name': 'Quantity warn on lot', | ||
'version': '0.1', | ||
'author': 'Savoir-faire Linux', | ||
'maintainer': 'Savoir-faire Linux', | ||
'website': 'http://www.savoirfairelinux.com', | ||
'license': 'AGPL-3', | ||
'category': 'Others', | ||
'summary': 'Warnings for invalid lot quantities', | ||
'description': """ | ||
Add a warning message when user is trying to book a stock move with a lot | ||
number having not enough quantity available. | ||
""", | ||
'depends': [ | ||
'stock', | ||
], | ||
'external_dependencies': { | ||
'python': [], | ||
}, | ||
'data': [ | ||
], | ||
'installable': True, | ||
'application': False, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Translation of OpenERP Server. | ||
# This file contains the translation of the following modules: | ||
# * quantity_warn_on_lot | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: OpenERP Server 7.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2015-04-15 22:11+0000\n" | ||
"PO-Revision-Date: 2015-04-15 22:11+0000\n" | ||
"Last-Translator: Loïc Faure-Lacroix<[email protected]>\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: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "{message}" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Continue" | ||
msgstr "Laisser tel quel" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:80 | ||
#, python-format | ||
msgid "Pressed continue button in the confirmation window" | ||
msgstr "A cliqué sur le bouton 'laisser tel quel' dans la fenêtre de confirmation." | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:61 | ||
#, python-format | ||
msgid "Pressed correct button in the confirmation window" | ||
msgstr "A cliqué sur le bouton 'modifier' dans la fenêtre de confirmations." | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:133 | ||
#, python-format | ||
msgid "The remaining amount of <b>%(product_name)s</b> in the lot <b>%(lot_number)s</b> isn't enough.The remaining amount of products in this lot number is <b>%(quantity)d</b>.Please correct your sale order" | ||
msgstr "La quantité restante de <b>%(product_name)s</b> du lot <b>%(lot_number)s</b> n'est pas suffisante. La quantité restante dans ce numéro de lot est <b>%(quantity)d</b>. Merci de corriger votre bon de livraison." | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Confirm move split" | ||
msgstr "Confirmez la division du mouvement" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: model:ir.model,name:quantity_warn_on_lot.model_stock_move_split | ||
msgid "Split in Serial Numbers" | ||
msgstr "Divisé en numéros de séries" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Correct" | ||
msgstr "Modifier" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Translation of OpenERP Server. | ||
# This file contains the translation of the following modules: | ||
# * quantity_warn_on_lot | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: OpenERP Server 7.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2015-04-15 22:11+0000\n" | ||
"PO-Revision-Date: 2015-04-15 22:11+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: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "{message}" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Continue" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:80 | ||
#, python-format | ||
msgid "Pressed continue button in the confirmation window" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:61 | ||
#, python-format | ||
msgid "Pressed correct button in the confirmation window" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: code:addons/quantity_warn_on_lot/models/stock_move_split.py:133 | ||
#, python-format | ||
msgid "The remaining amount of <b>%(product_name)s</b> in the lot <b>%(lot_number)s</b> of the product isn't enough.The remaining amount of products in this lot number is <b>%(quantity)d</b>.Please correct your sale order" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Confirm move split" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: model:ir.model,name:quantity_warn_on_lot.model_stock_move_split | ||
msgid "Split in Serial Numbers" | ||
msgstr "" | ||
|
||
#. module: quantity_warn_on_lot | ||
#: view:stock.move.split:0 | ||
msgid "Correct" | ||
msgstr "" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @llacroix Copyright? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
from . import stock_move_split |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# -*- coding: utf-8 -*- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @llacroix Copyright? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
import logging | ||
|
||
from openerp.osv import orm | ||
from openerp.tools.translate import _ | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
class StockMoveSplit(orm.TransientModel): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @llacroix In version 7.0 is more common to put wizards (models and views) in the wizard namespace (folder). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try to move that in a different folder with the according views. |
||
|
||
"""StockMoveSplit override to handle the amount of available products.""" | ||
|
||
_inherit = 'stock.move.split' | ||
|
||
def split(self, cr, uid, ids, move_ids, context=None): | ||
""" To split stock moves into serial numbers | ||
|
||
:param move_ids: the ID or list of IDs of stock move we want to split | ||
""" | ||
if context is None: | ||
context = {} | ||
base_func = super(StockMoveSplit, self).split | ||
res = base_func(cr, uid, ids, move_ids, context) | ||
move_obj = self.pool.get('stock.move') | ||
uom_obj = self.pool.get('product.uom') | ||
for data in self.browse(cr, uid, ids, context=context): | ||
for move in move_obj.browse(cr, uid, move_ids, context=context): | ||
product_uom = move.product_uom | ||
if data.use_exist: | ||
lines = [l for l in data.line_exist_ids if l] | ||
else: | ||
lines = [l for l in data.line_ids if l] | ||
total_move_qty = 0.0 | ||
for line in lines: | ||
quantity = line.quantity | ||
total_move_qty += quantity | ||
amount_actual = uom_obj._compute_qty_obj( | ||
cr, uid, move.product_uom, | ||
line.prodlot_id.stock_available, | ||
product_uom, context=context) | ||
if (data.location_id.usage == 'internal') and \ | ||
(quantity > (amount_actual or 0.0)): | ||
raise orm.except_orm( | ||
_('Insufficient Stock for Serial Number !'), | ||
_('You are moving %.2f %s but only %.2f %s ' | ||
'available for this serial number.') % | ||
(total_move_qty, move.product_uom.name, | ||
amount_actual, move.product_uom.name)) | ||
|
||
return res |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - Present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
from . import models | ||
from . import report |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# This module copyright (C) 2015 - Present Savoir-faire Linux | ||
# (<http://www.savoirfairelinux.com>). | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
{ | ||
'name': 'Stock available reserved quantity', | ||
'version': '1.0', | ||
'author': 'Savoir-faire Linux', | ||
'category': 'Warehouse', | ||
'depends': [ | ||
'stock' | ||
], | ||
'description': """\ | ||
Stock available reserved quantity | ||
================================= | ||
|
||
Configuration | ||
============= | ||
|
||
Usage | ||
===== | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Loïc Faure-Lacroix <[email protected]> | ||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: http://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: http://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit http://odoo-community.org.""", | ||
'license': 'AGPL-3', | ||
'data': [ | ||
"views/stock_production_lot.xml", | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to remove.