From 9502276166f95c451773a7c7358c83a6d4703f6e Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Mon, 10 Feb 2014 11:07:27 +0100 Subject: [PATCH 1/7] [FIX]work on view for better usability bzr revid: csn@openerp.com-20140210100727-1q2q61t3c3nxfd10 --- addons/delivery/delivery_view.xml | 2 +- addons/product/product.py | 2 +- addons/sale_stock/stock_view.xml | 11 -------- addons/stock/stock.py | 4 +-- addons/stock/stock_view.xml | 26 +++++++++++++++---- addons/stock/wizard/stock_move_view.xml | 3 +-- .../stock_picking_wave/stock_picking_wave.py | 5 +--- .../stock_picking_wave_demo.xml | 4 --- .../stock_picking_wave_view.xml | 15 +---------- 9 files changed, 28 insertions(+), 44 deletions(-) diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 237d18b5b49..d8560b2394c 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -235,13 +235,13 @@ - diff --git a/addons/product/product.py b/addons/product/product.py index 2bb6dfe8c5e..bd5acf731e6 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -130,7 +130,7 @@ class product_uom(osv.osv): _order = "name" _columns = { 'name': fields.char('Unit of Measure', required=True, translate=True), - 'category_id': fields.many2one('product.uom.categ', 'Category', required=True, ondelete='cascade', + 'category_id': fields.many2one('product.uom.categ', 'Product Category', required=True, ondelete='cascade', help="Conversion between Units of Measure can only occur if they belong to the same category. The conversion will be made based on the ratios."), 'factor': fields.float('Ratio', required=True,digits=(12, 12), help='How much bigger or smaller this unit is compared to the reference Unit of Measure for this category:\n'\ diff --git a/addons/sale_stock/stock_view.xml b/addons/sale_stock/stock_view.xml index 9d03ecd3e57..2c7c80ba25f 100644 --- a/addons/sale_stock/stock_view.xml +++ b/addons/sale_stock/stock_view.xml @@ -30,17 +30,6 @@ - - stock.location.route.tree.inherit - - stock.location.route - - - - - - - diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4ee6f3a926b..a275d8f35ae 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -111,7 +111,7 @@ class stock_location(osv.osv): 'parent_right': fields.integer('Right Parent', select=1), 'company_id': fields.many2one('res.company', 'Company', select=1, help='Let this field empty if this location is shared between all companies'), - 'scrap_location': fields.boolean('Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'), + 'scrap_location': fields.boolean('Is a Scrap Location', help='Check this box to allow using this location to put scrapped/damaged goods.'), 'removal_strategy_ids': fields.one2many('product.removal', 'location_id', 'Removal Strategies'), 'putaway_strategy_ids': fields.one2many('product.putaway', 'location_id', 'Put Away Strategies'), } @@ -2415,7 +2415,7 @@ class stock_warehouse(osv.osv): _description = "Warehouse" _columns = { - 'name': fields.char('Name', size=128, required=True, select=True), + 'name': fields.char('Warehouse Name', size=128, required=True, select=True), 'company_id': fields.many2one('res.company', 'Company', required=True, select=True), 'partner_id': fields.many2one('res.partner', 'Address'), 'view_location_id': fields.many2one('stock.location', 'View Location', required=True, domain=[('usage', '=', 'view')]), diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 303785da294..de46d21dc2b 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1016,6 +1016,18 @@ + + stock.move.graph + stock.move + + + + + + + + + stock.move.tree stock.move @@ -1254,6 +1266,13 @@ + + + graph + + + + @@ -2072,9 +2091,6 @@ - - - @@ -2093,10 +2109,10 @@ - + - + diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml index 8c90b27960f..c71db88a8e1 100644 --- a/addons/stock/wizard/stock_move_view.xml +++ b/addons/stock/wizard/stock_move_view.xml @@ -8,7 +8,6 @@ stock.move.scrap
-
-
diff --git a/addons/stock_picking_wave/stock_picking_wave.py b/addons/stock_picking_wave/stock_picking_wave.py index fa70f61c3bd..5050fe06996 100644 --- a/addons/stock_picking_wave/stock_picking_wave.py +++ b/addons/stock_picking_wave/stock_picking_wave.py @@ -6,12 +6,9 @@ class stock_picking_wave(osv.osv): _name = "stock.picking.wave" _order = "name desc" _columns = { - 'name': fields.char('name', required=True, help='Name of the picking wave'), + 'name': fields.char('Picking wave name', required=True, help='Name of the picking wave'), 'user_id': fields.many2one('res.users', 'Responsible', help='Person responsible for this wave'), - 'time': fields.float('Time', help='Time it will take to perform the wave'), 'picking_ids': fields.one2many('stock.picking', 'wave_id', 'Pickings', help='List of picking associated to this wave'), - 'capacity': fields.float('Capacity', help='The capacity of the transport used to get the goods'), - 'capacity_uom': fields.many2one('product.uom', 'Unit of Measure', help='The Unity Of Measure of the transport capacity'), 'state': fields.selection([('draft', 'Draft'), ('in_progress', 'Running'), ('done', 'Done'), ('cancel', 'Cancelled')], required=True), } diff --git a/addons/stock_picking_wave/stock_picking_wave_demo.xml b/addons/stock_picking_wave/stock_picking_wave_demo.xml index 0ef026422ec..890adf104f6 100644 --- a/addons/stock_picking_wave/stock_picking_wave_demo.xml +++ b/addons/stock_picking_wave/stock_picking_wave_demo.xml @@ -6,15 +6,11 @@ --> Picking Dry for John - 15 - in_progress Picking Freeze for Mickael - 600 - in_progress diff --git a/addons/stock_picking_wave/stock_picking_wave_view.xml b/addons/stock_picking_wave/stock_picking_wave_view.xml index c6f920e01d2..450232603e1 100644 --- a/addons/stock_picking_wave/stock_picking_wave_view.xml +++ b/addons/stock_picking_wave/stock_picking_wave_view.xml @@ -21,17 +21,7 @@ - - - - - + @@ -60,9 +50,6 @@ - - - From b8826aaa30999120488cab7f158a00b42414e1b4 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 12 Feb 2014 13:46:46 +0100 Subject: [PATCH 2/7] [FIX]various usability thing bzr revid: csn@openerp.com-20140212124646-301rfsr1712cdy18 --- addons/product/product.py | 2 +- addons/stock/stock.py | 20 +++++++++++++++++++ .../wizard/stock_valuation_history.py | 6 ++++-- .../wizard/stock_valuation_history_view.xml | 20 +++++++++++++++++-- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index bd5acf731e6..9169ec99ead 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -578,7 +578,7 @@ class product_product(osv.osv): if context is None: context = {} product = self.browse(cr, uid, product_id, context=context) - date = context.get('history_date', time.strftime('%Y-%m-%d %H:%M:%s')) + date = context.get('history_date', time.strftime('%Y-%m-%d %H:%M:%S')) prices_history_obj = self.pool.get('prices.history') history_ids = prices_history_obj.search(cr, uid, [('company_id', '=', company_id), ('product_template_id', '=', product.product_tmpl_id.id), ('datetime', '<=', date)], limit=1) if history_ids: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c20b47e99d3..9ba82dc1da4 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -82,6 +82,26 @@ class stock_location(osv.osv): context_with_inactive['active_test'] = False return self.search(cr, uid, [('id', 'child_of', ids)], context=context_with_inactive) + def _name_get(self, cr, uid, browse_location, context=None): + # browse_location = self.browse(cr, uid, id, context=context) + location_type = browse_location.usage + name = '' + while location_type != 'view': + name = browse_location.name + '/' + name + browse_location = browse_location.location_id + location_type = browse_location.usage + name = browse_location.name + '/' + name + return name + + def name_get(self, cr, uid, ids, context=None): + if not ids: + return [] + #reads = self.read(cr, uid, ids, ['name','location_id'], context=context) + res = [] + for location in self.browse(cr, uid, ids, context=context): + res.append((location.id, self._name_get(cr, uid, location, context=context))) + return res + _columns = { 'name': fields.char('Location Name', size=64, required=True, translate=True), 'active': fields.boolean('Active', help="By unchecking the active field, you may hide a location without deleting it."), diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index a56726bb1c6..ff3c1afc48e 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -8,10 +8,12 @@ class wizard_valuation_history(osv.osv_memory): _name = 'wizard.valuation.history' _description = 'Wizard that opens the stock valuation history table' _columns = { + 'choose_date': fields.boolean('Choose a particular date'), 'date': fields.datetime('Date', required=True), } _defaults = { + 'choose_date': False, 'date': fields.datetime.now, } @@ -27,7 +29,7 @@ class wizard_valuation_history(osv.osv_memory): 'domain': "[('date', '<=', '" + data['date'] + "')]", 'name': _('Stock Value At Date'), 'view_type': 'form', - 'view_mode': 'tree', + 'view_mode': 'tree,graph', 'res_model': 'stock.history', 'type': 'ir.actions.act_window', 'context': ctx, @@ -68,7 +70,7 @@ class stock_history(osv.osv): 'location_id': fields.many2one('stock.location', 'Location', required=True), 'product_id': fields.many2one('product.product', 'Product', required=True), 'product_categ_id': fields.many2one('product.category', 'Product Category', required=True), - 'quantity': fields.integer('Quantity'), + 'quantity': fields.integer('Quant quantity'), 'date': fields.datetime('Operation Date'), 'price_unit_on_quant': fields.float('Value'), 'cost_method': fields.char('Cost Method'), diff --git a/addons/stock_account/wizard/stock_valuation_history_view.xml b/addons/stock_account/wizard/stock_valuation_history_view.xml index 51594478759..1b398a5810b 100644 --- a/addons/stock_account/wizard/stock_valuation_history_view.xml +++ b/addons/stock_account/wizard/stock_valuation_history_view.xml @@ -7,14 +7,18 @@ wizard.valuation.history -

+

Choose the date for wich you want to get the stock valuation of your products. This will filter the stock operation that weren't done at the selected date, to retreive the quantity you had, and gives you the inventory value according to the standard price used at that time.

+

+ Retrieve the stock valuation of your products at current day +

- + +