From dec4a927762fcf37734c878c8e592677f9f0727b Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 17 Mar 2014 10:06:56 +0100 Subject: [PATCH] [FIX] stock: don't allow to make an inventory with a date in the future bzr revid: qdp-launchpad@openerp.com-20140317090656-o7lo22tzm8yuv3r8 --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7916635c995..b0c19c1a25b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2359,6 +2359,8 @@ class stock_inventory(osv.osv): inventory_line_obj = self.pool.get('stock.inventory.line') for inventory in self.browse(cr, uid, ids, context=context): #check inventory start date is allowed + if inventory.date > time.strftime(DEFAULT_SERVER_DATETIME_FORMAT): + raise osv.except_osv(_('Error!'), _('It\'s impossible to confirm an inventory in the future. Please change the inventory date to proceed further.')) conflicting_move_ids = self.check_inventory_date(cr, uid, inventory, context=context) error_message = "" for move in self.pool.get('stock.move').browse(cr, uid, conflicting_move_ids, context=context):