From c0875efba1f51c8bd4c00401abfc02d641ae3fb9 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Tue, 15 Jul 2014 15:26:18 +0200 Subject: [PATCH 1/6] [IMP] Improve stock's barcode start page remove module_boot() usage --- addons/stock/controllers/main.py | 60 +---------------------------- addons/stock/views/stock.xml | 65 +++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 65 deletions(-) diff --git a/addons/stock/controllers/main.py b/addons/stock/controllers/main.py index ad8aa8826af..fa2744a4498 100644 --- a/addons/stock/controllers/main.py +++ b/addons/stock/controllers/main.py @@ -1,57 +1,11 @@ # -*- coding: utf-8 -*- import logging -import simplejson from openerp import http from openerp.http import request -from openerp.addons.web.controllers.main import module_boot _logger = logging.getLogger(__name__) -html_template = """ - - - Barcode Scanner - - - - - - - - - - - - - - - - - - - -
- - - -
-
-
- - - - -""" - class BarcodeController(http.Controller): @http.route(['/barcode/web/'], type='http', auth='user') @@ -59,16 +13,4 @@ class BarcodeController(http.Controller): if not request.session.uid: return http.local_redirect('/web/login?redirect=/barcode/web') - r = html_template % { - 'modules': simplejson.dumps(module_boot(request.db)), - 'init': """ - var wc = new s.web.WebClient(); - wc.show_application = function(){ - wc.action_manager.do_action("stock.ui", {}); - }; - wc.do_push_state = function(state){}; - wc.setElement($(document.body)); - wc.start(); - """ - } - return r + return request.render('stock.barcode_index') diff --git a/addons/stock/views/stock.xml b/addons/stock/views/stock.xml index a38fe9bb9fe..f5bca7a8f7c 100644 --- a/addons/stock/views/stock.xml +++ b/addons/stock/views/stock.xml @@ -3,11 +3,64 @@ --> - + + + + + From 72e0cbf0367a9d64370813998f894db3068c856f Mon Sep 17 00:00:00 2001 From: Yogesh Parekh Date: Tue, 15 Jul 2014 19:26:40 +0530 Subject: [PATCH 2/6] [IMP] Change string 'brand' by 'make' in fleet module --- addons/fleet/fleet.py | 4 ++-- addons/fleet/fleet_view.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index 44dd9abc1f4..266dd08e2e4 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -146,7 +146,7 @@ class fleet_vehicle_model(osv.Model): _columns = { 'name': fields.function(_model_name_get_fnc, type="char", string='Name', store=True), 'modelname': fields.char('Model name', required=True), - 'brand_id': fields.many2one('fleet.vehicle.model.brand', 'Model Brand', required=True, help='Brand of the vehicle'), + 'brand_id': fields.many2one('fleet.vehicle.model.brand', 'Make', required=True, help='Make of the vehicle'), 'vendors': fields.many2many('res.partner', 'fleet_vehicle_model_vendors', 'model_id', 'partner_id', string='Vendors'), 'image': fields.related('brand_id', 'image', type="binary", string="Logo"), 'image_medium': fields.related('brand_id', 'image_medium', type="binary", string="Logo (medium)"), @@ -170,7 +170,7 @@ class fleet_vehicle_model_brand(osv.Model): return self.write(cr, uid, [id], {'image': tools.image_resize_image_big(value)}, context=context) _columns = { - 'name': fields.char('Brand Name', required=True), + 'name': fields.char('Make', required=True), 'image': fields.binary("Logo", help="This field holds the image used as logo for the brand, limited to 1024x1024px."), 'image_medium': fields.function(_get_image, fnct_inv=_set_image, diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index 8cda28d56a5..d1d0e557f43 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -62,7 +62,7 @@ - + @@ -78,7 +78,7 @@

Click to create a new model.

- You can define several models (e.g. A3, A4) for each brand (Audi). + You can define several models (e.g. A3, A4) for each make (Audi).

@@ -87,7 +87,7 @@ fleet.vehicle.model.brand.tree fleet.vehicle.model.brand - + @@ -97,7 +97,7 @@ fleet.vehicle.model.brand.form fleet.vehicle.model.brand -
+
@@ -144,13 +144,13 @@ - Model brand of Vehicle + Model make of Vehicle fleet.vehicle.model.brand form kanban,tree,form

- Click to create a new brand. + Click to create a new make.

From dfa4d92eca2ff5c8ee511a81dfb759796d69ab02 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 16 Jul 2014 10:25:53 +0200 Subject: [PATCH 3/6] [IMP] changed barcode start page url to /stock/barcode As a convention we use the module name as first fragment of the url --- addons/stock/controllers/main.py | 4 ++-- addons/stock/stock.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/stock/controllers/main.py b/addons/stock/controllers/main.py index fa2744a4498..44531169254 100644 --- a/addons/stock/controllers/main.py +++ b/addons/stock/controllers/main.py @@ -8,9 +8,9 @@ _logger = logging.getLogger(__name__) class BarcodeController(http.Controller): - @http.route(['/barcode/web/'], type='http', auth='user') + @http.route(['/stock/barcode/'], type='http', auth='user') def a(self, debug=False, **k): if not request.session.uid: - return http.local_redirect('/web/login?redirect=/barcode/web') + return http.local_redirect('/web/login?redirect=/stock/barcode/') return request.render('stock.barcode_index') diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 8da55a82fcb..1146d628ac9 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1070,7 +1070,7 @@ class stock_picking(osv.osv): @api.cr_uid_ids_context def open_barcode_interface(self, cr, uid, picking_ids, context=None): - final_url="/barcode/web/#action=stock.ui&picking_id="+str(picking_ids[0]) + final_url="/stock/barcode/#action=stock.ui&picking_id="+str(picking_ids[0]) return {'type': 'ir.actions.act_url', 'url':final_url, 'target': 'self',} @api.cr_uid_ids_context @@ -4038,7 +4038,7 @@ class stock_picking_type(osv.osv): _order = 'sequence' def open_barcode_interface(self, cr, uid, ids, context=None): - final_url = "/barcode/web/#action=stock.ui&picking_type_id=" + str(ids[0]) if len(ids) else '0' + final_url = "/stock/barcode/#action=stock.ui&picking_type_id=" + str(ids[0]) if len(ids) else '0' return {'type': 'ir.actions.act_url', 'url': final_url, 'target': 'self'} def _get_tristate_values(self, cr, uid, ids, field_name, arg, context=None): From dad761ae10f370feec8f121e89fee6cdbe3399b9 Mon Sep 17 00:00:00 2001 From: Mehul Mehta Date: Tue, 15 Jul 2014 12:26:25 +0530 Subject: [PATCH 4/6] [IMP] sale: small view changes in quotation Closes #1259 --- addons/sale/sale.py | 2 +- addons/sale/sale_view.xml | 6 +++--- addons/sale_crm/sale_crm_view.xml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8881e917269..8903f321310 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -174,7 +174,7 @@ class sale_order(osv.osv): 'name': fields.char('Order Reference', required=True, copy=False, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, select=True), 'origin': fields.char('Source Document', help="Reference of the document that generated this sales order request."), - 'client_order_ref': fields.char('Reference/Description', copy=False), + 'client_order_ref': fields.char('Customer Reference', copy=False), 'state': fields.selection([ ('draft', 'Draft Quotation'), ('sent', 'Quotation Sent'), diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 13e5d952006..0295e61f516 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -76,18 +76,18 @@