From 5b85b245b505cc6e25595983735a29fd78727e79 Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP Trainee)" Date: Tue, 27 Aug 2013 14:04:59 +0530 Subject: [PATCH 01/12] [IMP]:Stock:Form view and Stock Help bzr revid: sunilsharma.sharma07@gmail.com-20130827083459-lv6ic79k88h843eu --- addons/stock/stock.py | 17 +++++++++-------- addons/stock/stock_view.xml | 11 ++++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 54f473f75c1..4752376a085 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1662,18 +1662,18 @@ class stock_inventory(osv.osv): return res _columns = { - 'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}), - 'date': fields.datetime('Creation Date', required=True, readonly=True, states={'draft': [('readonly', False)]}), - 'date_done': fields.datetime('Date done'), + 'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Name."), + 'date': fields.datetime('Creation Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."), + 'date_done': fields.datetime('Date done', help="Inventory Date time."), 'line_ids': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=False, states={'done': [('readonly', True)]}), 'move_ids': fields.one2many('stock.move', 'inventory_id', 'Created Moves'), - 'state': fields.selection([('draft', 'Draft'), ('cancel', 'Cancelled'), ('confirm', 'Confirmed'), ('done', 'Done')], 'Status', readonly=True, select=True), - 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), - 'location_id': fields.many2one('stock.location', 'Location', required=True), - 'product_id': fields.many2one('product.product', 'Product'), + 'state': fields.selection([('draft', 'Draft'), ('cancel', 'Cancelled'), ('confirm', 'In Progress'), ('done', 'Validated')], 'Status', readonly=True, select=True), + 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}, help="Your Company Name."), + 'location_id': fields.many2one('stock.location', 'Location', required=True, help="Physical location stock name."), + 'product_id': fields.many2one('product.product', 'Product', help="Product Name"), 'package_id': fields.many2one('stock.quant.package', 'Pack'), 'partner_id': fields.many2one('res.partner', 'Owner'), - 'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number'), + 'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"), 'move_ids_exist': fields.function(_get_move_ids_exist, type='boolean', string=' Stock Move Exists?', help='technical field for attrs in view'), } @@ -1837,6 +1837,7 @@ class stock_inventory_line(osv.osv): 'company_id': fields.related('inventory_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, select=True, readonly=True), 'prod_lot_id': fields.many2one('stock.production.lot', 'Serial Number', domain="[('product_id','=',product_id)]"), 'state': fields.related('inventory_id', 'state', type='char', string='Status', readonly=True), + 'real_qty':fields.related('product_id','qty_available', type='float',string='Real Quantity',store=True), } def _resolve_inventory_line(self, cr, uid, inventory_line, theorical_lines, context=None): diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index af3fa1153f4..8a0ed746544 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -101,11 +101,11 @@
-
@@ -130,11 +130,12 @@ - + - + + @@ -143,7 +144,7 @@ - + From 14dac5ce8c35be6a0d2acf22fce251c22ec79364 Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Tue, 27 Aug 2013 15:19:00 +0530 Subject: [PATCH 02/12] [IMP] apply color in inventory line and improved help bzr revid: tpa@tinyerp.com-20130827094900-xq7eful67vimd2xk --- addons/stock/stock.py | 14 +++++++------- addons/stock/stock_view.xml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4752376a085..50f568a5110 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1664,16 +1664,16 @@ class stock_inventory(osv.osv): _columns = { 'name': fields.char('Inventory Reference', size=64, required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Name."), 'date': fields.datetime('Creation Date', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="Inventory Create Date."), - 'date_done': fields.datetime('Date done', help="Inventory Date time."), - 'line_ids': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=False, states={'done': [('readonly', True)]}), - 'move_ids': fields.one2many('stock.move', 'inventory_id', 'Created Moves'), + 'date_done': fields.datetime('Date done', help="Inventory Validation Date."), + 'line_ids': fields.one2many('stock.inventory.line', 'inventory_id', 'Inventories', readonly=False, states={'done': [('readonly', True)]}, help="Inventory Lines."), + 'move_ids': fields.one2many('stock.move', 'inventory_id', 'Created Moves', help="Inventory Moves."), 'state': fields.selection([('draft', 'Draft'), ('cancel', 'Cancelled'), ('confirm', 'In Progress'), ('done', 'Validated')], 'Status', readonly=True, select=True), - 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}, help="Your Company Name."), - 'location_id': fields.many2one('stock.location', 'Location', required=True, help="Physical location stock name."), + 'company_id': fields.many2one('res.company', 'Company', required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), + 'location_id': fields.many2one('stock.location', 'Location', required=True), 'product_id': fields.many2one('product.product', 'Product', help="Product Name"), 'package_id': fields.many2one('stock.quant.package', 'Pack'), 'partner_id': fields.many2one('res.partner', 'Owner'), - 'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"), + 'lot_id': fields.many2one('stock.production.lot', 'Lot/Serial Number', help="Forces to specify a Serial Number for all moves generated by Inventoty"), 'move_ids_exist': fields.function(_get_move_ids_exist, type='boolean', string=' Stock Move Exists?', help='technical field for attrs in view'), } @@ -1837,7 +1837,7 @@ class stock_inventory_line(osv.osv): 'company_id': fields.related('inventory_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, select=True, readonly=True), 'prod_lot_id': fields.many2one('stock.production.lot', 'Serial Number', domain="[('product_id','=',product_id)]"), 'state': fields.related('inventory_id', 'state', type='char', string='Status', readonly=True), - 'real_qty':fields.related('product_id','qty_available', type='float',string='Real Quantity',store=True), + 'real_qty':fields.related('product_id','qty_available', type='float', string='Real Quantity', store=True), } def _resolve_inventory_line(self, cr, uid, inventory_line, theorical_lines, context=None): diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 8a0ed746544..00ac2e22289 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -132,7 +132,7 @@ - + From bfb37ae966c3c17dac72999888c0663628b81db6 Mon Sep 17 00:00:00 2001 From: "Sunil Sharma (OpenERP Trainee)" Date: Tue, 27 Aug 2013 15:36:38 +0530 Subject: [PATCH 03/12] [IMP]:Stock:Set Button Check Qty bzr revid: sunilsharma.sharma07@gmail.com-20130827100638-kh8qmle7fab9nkff --- addons/stock/stock.py | 6 ++++++ addons/stock/stock_view.xml | 1 + 2 files changed, 7 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4752376a085..8b7adf57eaa 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1691,6 +1691,12 @@ class stock_inventory(osv.osv): 'location_id': _default_stock_location, } + def set_checked_qty(self , cr ,uid ,ids ,context=None): + inventory = self.browse(cr, uid, ids[0], context=context) + line_ids = [line.id for line in inventory.line_ids] + self.pool.get('stock.inventory.line').write(cr, uid, line_ids, {'product_qty': 0}) + return True + def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 8a0ed746544..76b4cdbd739 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -131,6 +131,7 @@ +