diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 237d18b5b49..055ca985494 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -27,15 +27,13 @@ - + + + + - - - - - + + + @@ -235,13 +235,13 @@ - diff --git a/addons/mrp/stock.py b/addons/mrp/stock.py index 59b41e71c90..1863959882e 100644 --- a/addons/mrp/stock.py +++ b/addons/mrp/stock.py @@ -259,11 +259,12 @@ class stock_warehouse(osv.osv): all_routes += [warehouse.manufacture_pull_id.route_id.id] return all_routes - def _handle_renaming(self, cr, uid, warehouse, name, context=None): - res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, context=context) + def _handle_renaming(self, cr, uid, warehouse, name, code, context=None): + res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, code, context=context) pull_obj = self.pool.get('procurement.rule') #change the manufacture pull rule name - pull_obj.write(cr, uid, warehouse.manufacture_pull_id.id, {'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)}, context=context) + if warehouse.manufacture_pull_id: + pull_obj.write(cr, uid, warehouse.manufacture_pull_id.id, {'name': warehouse.manufacture_pull_id.name.replace(warehouse.name, name, 1)}, context=context) return res def _get_all_products_to_resupply(self, cr, uid, warehouse, context=None): diff --git a/addons/product/product.py b/addons/product/product.py index 2bb6dfe8c5e..9169ec99ead 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'\ @@ -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/purchase/stock.py b/addons/purchase/stock.py index 06b484ec149..f0adb7b2afc 100644 --- a/addons/purchase/stock.py +++ b/addons/purchase/stock.py @@ -148,11 +148,12 @@ class stock_warehouse(osv.osv): break return res - def _handle_renaming(self, cr, uid, warehouse, name, context=None): - res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, context=context) + def _handle_renaming(self, cr, uid, warehouse, name, code, context=None): + res = super(stock_warehouse, self)._handle_renaming(cr, uid, warehouse, name, code, context=context) pull_obj = self.pool.get('procurement.rule') #change the buy pull rule name - pull_obj.write(cr, uid, warehouse.buy_pull_id.id, {'name': warehouse.buy_pull_id.name.replace(warehouse.name, name, 1)}, context=context) + if warehouse.buy_pull_id: + pull_obj.write(cr, uid, warehouse.buy_pull_id.id, {'name': warehouse.buy_pull_id.name.replace(warehouse.name, name, 1)}, context=context) return res def change_route(self, cr, uid, ids, warehouse, new_reception_step=False, new_delivery_step=False, context=None): 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 5e409242f50..20a6d8b1622 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -82,6 +82,19 @@ 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, location, context=None): + name = location.name + while location.location_id and location.usage != 'view': + location = location.location_id + name = location.name + '/' + name + return name + + def name_get(self, cr, uid, ids, context=None): + 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."), @@ -2398,7 +2411,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')]), @@ -2756,7 +2769,7 @@ class stock_warehouse(osv.osv): #create view location for warehouse wh_loc_id = location_obj.create(cr, uid, { - 'name': _(vals.get('name')), + 'name': _(vals.get('code')), 'usage': 'view', 'location_id': data_obj.get_object_reference(cr, uid, 'stock', 'stock_location_locations')[1] }, context=context) @@ -2913,14 +2926,14 @@ class stock_warehouse(osv.osv): 'pick_pack_ship': (_('Pick + Pack + Ship'), [(warehouse.lot_stock_id, warehouse.wh_pack_stock_loc_id, warehouse.pick_type_id.id), (warehouse.wh_pack_stock_loc_id, warehouse.wh_output_stock_loc_id, warehouse.pack_type_id.id), (warehouse.wh_output_stock_loc_id, customer_loc, warehouse.out_type_id.id)]), } - def _handle_renaming(self, cr, uid, warehouse, name, context=None): + def _handle_renaming(self, cr, uid, warehouse, name, code, context=None): location_obj = self.pool.get('stock.location') route_obj = self.pool.get('stock.location.route') pull_obj = self.pool.get('procurement.rule') push_obj = self.pool.get('stock.location.path') #rename location location_id = warehouse.lot_stock_id.location_id.id - location_obj.write(cr, uid, location_id, {'name': name}, context=context) + location_obj.write(cr, uid, location_id, {'name': code}, context=context) #rename route and push-pull rules for route in warehouse.route_ids: route_obj.write(cr, uid, route.id, {'name': route.name.replace(warehouse.name, name, 1)}, context=context) @@ -2948,12 +2961,13 @@ class stock_warehouse(osv.osv): self.switch_location(cr, uid, warehouse.id, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context) # switch between route self.change_route(cr, uid, ids, warehouse, vals.get('reception_steps', False), vals.get('delivery_steps', False), context=context_with_inactive) + warehouse.refresh() if vals.get('code') or vals.get('name'): name = warehouse.name #rename sequence if vals.get('name'): - name = vals.get('name') - self._handle_renaming(cr, uid, warehouse, name, context=context_with_inactive) + name = vals.get('name', warehouse.name) + self._handle_renaming(cr, uid, warehouse, name, vals.get('code', warehouse.code), context=context_with_inactive) seq_obj.write(cr, uid, warehouse.in_type_id.sequence_id.id, {'name': name + _(' Sequence in'), 'prefix': vals.get('code', warehouse.code) + '\IN\\'}, context=context) seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context) seq_obj.write(cr, uid, warehouse.pack_type_id.sequence_id.id, {'name': name + _(' Sequence packing'), 'prefix': vals.get('code', warehouse.code) + '\PACK\\'}, context=context) @@ -3773,7 +3787,7 @@ class stock_picking_type(osv.osv): return res and res[0] or False _columns = { - 'name': fields.char('Name', translate=True, required=True), + 'name': fields.char('Picking Type Name', translate=True, required=True), 'complete_name': fields.function(_get_name, type='char', string='Name'), 'auto_force_assign': fields.boolean('Automatic Availability', help='This picking type does\'t need to check for the availability in source location.'), 'color': fields.integer('Color'), diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 208907a262a..e693c85ea85 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -585,16 +585,6 @@ - - stock.location.tree - stock.location - child_ids - - - - - - {'product_id': active_id} Stock by Location @@ -605,29 +595,6 @@ Moves stock.move - - Inventory by Location - stock.location - ir.actions.act_window - [('location_id','=',False)] - tree - - -

- Click to add a location. -

- This is the structure of your company's warehouses and - locations. You can click on a location to get the list of the - products and their stock level in this particular location and - all its children. -

-
-
- stock.warehouse @@ -816,11 +783,10 @@ - + - @@ -828,6 +794,7 @@ + @@ -1016,6 +983,18 @@ + + stock.move.graph + stock.move + + + + + + + + + stock.move.tree stock.move @@ -1254,6 +1233,13 @@ + + + graph + + + + @@ -2069,9 +2055,6 @@ - - -
@@ -2090,10 +2073,10 @@ - + - + diff --git a/addons/stock/wizard/stock_move_view.xml b/addons/stock/wizard/stock_move_view.xml index 8c90b27960f..583cf952c84 100644 --- a/addons/stock/wizard/stock_move_view.xml +++ b/addons/stock/wizard/stock_move_view.xml @@ -7,8 +7,7 @@ Scrap Move stock.move.scrap -
- +
-
diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index a56726bb1c6..7657ac53b4b 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('Product 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..ea8b983f13e 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 +

- + +