From df4a5a580b6ebd2201eb7db22d8d48c4adc41d36 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Mon, 9 Jul 2012 16:17:20 +0530 Subject: [PATCH 1/8] [IMP]If there is not available db, jump direclty in the db manager view (creation of a db) instead of staying in the login page. bzr revid: sgo@tinyerp.com-20120709104720-0oi5975lfropyh4w --- addons/web/static/src/js/chrome.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index b87ebe56856..ffecd3289db 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -486,7 +486,7 @@ instance.web.Login = instance.web.Widget.extend({ var self = this; self.$element.find("form").submit(self.on_submit); - + self.$element.find('.oe_login_manage_db').click(function() { self.$element.find('.oe_login_bottom').hide(); self.$element.find('.oe_login_pane').hide(); @@ -515,12 +515,25 @@ instance.web.Login = instance.web.Widget.extend({ return d; }, _db_list_loaded: function () { + var self = this; var list = this._db_list, dbdiv = this.$element.find('div.oe_login_dbpane'); this.$element.find("[name=db]").replaceWith(instance.web.qweb.render('Login.dblist', { db_list: list, selected_db: this.selected_db})); if(list && list.length === 1) { dbdiv.hide(); - } else { + } + if(list.length === 0){ + self.$element.find('.oe_login_bottom').hide(); + self.$element.find('.oe_login_pane').hide(); + self.databasemanager = new instance.web.DatabaseManager(self); + self.databasemanager.appendTo(self.$element); + self.databasemanager.do_exit.add_last(function() { + self.databasemanager.destroy(); + self.$element.find('.oe_login_bottom').show(); + self.$element.find('.oe_login_pane').show(); + }); + } + else { dbdiv.show(); } }, From 09a63068a2e800ff0079446283262f62c17cbcb8 Mon Sep 17 00:00:00 2001 From: "Sanjay Gohel (Open ERP)" Date: Tue, 10 Jul 2012 14:52:55 +0530 Subject: [PATCH 2/8] [IMP]minor imp bzr revid: sgo@tinyerp.com-20120710092255-00eo11hm33ejhmnc --- addons/web/static/src/js/chrome.js | 34 +++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index ffecd3289db..ff9f2c89a0e 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -482,22 +482,26 @@ instance.web.Login = instance.web.Widget.extend({ } } }, + open_db_manager: function(){ + var self = this; + self.$element.find('.oe_login_bottom').hide(); + self.$element.find('.oe_login_pane').hide(); + self.databasemanager = new instance.web.DatabaseManager(self); + self.databasemanager.appendTo(self.$element); + self.databasemanager.do_exit.add_last(function() { + self.databasemanager.destroy(); + self.$element.find('.oe_login_bottom').show(); + self.$element.find('.oe_login_pane').show(); + self.load_db_list(true).then(self.proxy('_db_list_loaded')); + }); + }, start: function() { var self = this; self.$element.find("form").submit(self.on_submit); self.$element.find('.oe_login_manage_db').click(function() { - self.$element.find('.oe_login_bottom').hide(); - self.$element.find('.oe_login_pane').hide(); - self.databasemanager = new instance.web.DatabaseManager(self); - self.databasemanager.appendTo(self.$element); - self.databasemanager.do_exit.add_last(function() { - self.databasemanager.destroy(); - self.$element.find('.oe_login_bottom').show(); - self.$element.find('.oe_login_pane').show(); - self.load_db_list(true).then(self.proxy('_db_list_loaded')); - }); + self.open_db_manager(); }); return self.load_db_list().then(self.proxy('_db_list_loaded')); }, @@ -523,15 +527,7 @@ instance.web.Login = instance.web.Widget.extend({ dbdiv.hide(); } if(list.length === 0){ - self.$element.find('.oe_login_bottom').hide(); - self.$element.find('.oe_login_pane').hide(); - self.databasemanager = new instance.web.DatabaseManager(self); - self.databasemanager.appendTo(self.$element); - self.databasemanager.do_exit.add_last(function() { - self.databasemanager.destroy(); - self.$element.find('.oe_login_bottom').show(); - self.$element.find('.oe_login_pane').show(); - }); + self.open_db_manager(); } else { dbdiv.show(); From 5d669143c3705129647e5bade569d4c11159f0d0 Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Fri, 13 Jul 2012 15:46:16 +0200 Subject: [PATCH 3/8] Restyling of form listview subtotals bzr revid: mit@openerp.com-20120713134616-rpntccxdiei562u6 --- addons/web/static/src/css/base.css | 15 ++++++++------- addons/web/static/src/css/base.sass | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 05c0a9b68b8..3f410ff3fa2 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "utf-8"; +@charset "UTF-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -34,7 +34,7 @@ background: white; /* http://www.quirksmode.org/dom/inputfile.html * http://stackoverflow.com/questions/2855589/replace-input-type-file-by-an-image - */ */ + */ } .openerp a { text-decoration: none; @@ -1840,18 +1840,18 @@ .openerp .oe_form .oe_subtotal_footer td.oe_form_group_cell_label { border-right: none; } -.openerp .oe_form .oe_subtotal_footer .oe_form_field { - width: auto !important; -} .openerp .oe_form .oe_subtotal_footer .oe_subtotal_footer_separator { border-top: 1px solid #cacaca; - font-sie: 120%; font-weight: bold; + font-size: 18px; } .openerp .oe_form .oe_subtotal_footer label.oe_subtotal_footer_separator { font-weight: bold !important; padding: 2px 8px 2px 0px !important; } +.openerp .oe_form .oe_subtotal_footer label.oe_form_label_help { + font-weight: normal; +} .openerp .oe_application .oe_form_sheetbg { background: url(/web/static/src/img/form_sheetbg.png); padding: 8px 0; @@ -1993,7 +1993,7 @@ width: 180px; } .openerp .oe_form .oe_form_field_float { - width: 180px; + width: 112px; } .openerp .oe_form .oe_form_field_date { width: 7.5em; @@ -2250,6 +2250,7 @@ } .openerp .oe_list_content > tbody > tr > td.oe_number { text-align: right !important; + width: 100px; } .openerp .oe_list_content > tbody > tr:nth-child(odd) { background-color: #f0f0fa; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index f6e3e9a6ea2..1ccf24ad9c4 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1430,15 +1430,15 @@ $sheet-max-width: 860px padding: 0 !important td.oe_form_group_cell_label border-right: none - .oe_form_field - width: auto !important .oe_subtotal_footer_separator border-top: 1px solid #cacaca - font-sie: 120% font-weight: bold + font-size: 18px label.oe_subtotal_footer_separator font-weight: bold !important padding: 2px 8px 2px 0px !important + label.oe_form_label_help + font-weight: normal // no sheet in popups .oe_application .oe_form_sheetbg @@ -1558,7 +1558,7 @@ $sheet-max-width: 860px .oe_form_field_integer width: 180px .oe_form_field_float - width: 180px + width: 112px .oe_form_field_date width: 7.5em .oe_form_field_datetime @@ -1773,6 +1773,7 @@ $sheet-max-width: 860px border-width: 0 > td.oe_number text-align: right !important + width: 100px > tr:nth-child(odd) background-color: #f0f0fa @include vertical-gradient(#f0f0fa, #eeeef6) From 259dd3147dc7d418fe1ba84591df96fe7611c916 Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Fri, 13 Jul 2012 16:12:37 +0200 Subject: [PATCH 4/8] relooking one2many listview and changed padding in popup bzr revid: mit@openerp.com-20120713141237-on8z29w5dnh2at2z --- addons/web/static/src/css/base.css | 10 ++++++---- addons/web/static/src/css/base.sass | 9 ++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 3f410ff3fa2..466faec219a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1763,10 +1763,6 @@ .openerp .oe_form_readonly .oe_form .oe_form_field_date { width: auto; } -.openerp .oe_form_nosheet { - margin-left: 10px; - margin-right: 10px; -} .openerp .oe_form_nosheet > header { margin-left: -10px; margin-right: -10px; @@ -2150,6 +2146,12 @@ .openerp .oe_form .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page { display: none; } +.openerp .oe_form_field_one2many .oe_list_content > thead { + border-bottom: 1px; +} +.openerp .oe_form_field_one2many .oe_list_content > tbody tr:nth-child(odd) { + background: transparent; +} .openerp .oe_form_field_one2many .oe_list .oe_list_edit_row_save { background: url(/web/static/src/img/iconset-b-remove.png) 50% 50% no-repeat; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 1ccf24ad9c4..ea052495911 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1372,9 +1372,6 @@ $sheet-max-width: 860px display: none !important .oe_form .oe_form_field_date width: auto - .oe_form_nosheet - margin-left: 10px - margin-right: 10px .oe_form_nosheet > header margin-left: -10px margin-right: -10px @@ -1693,6 +1690,12 @@ $sheet-max-width: 860px display: none .oe_form_field_one2many // TODO: oe_form_field_one2many_list? + .oe_list_content + > thead + border-bottom: 1px + > tbody + tr:nth-child(odd) + background: transparent .oe_list .oe_list_edit_row_save background: url(/web/static/src/img/iconset-b-remove.png) 50% 50% no-repeat &:before From 71a5c53072341f784d1eb87e561f59823fbb1651 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 13 Jul 2012 16:57:40 +0200 Subject: [PATCH 5/8] [IMP] allow xml ids for action_id bzr revid: al@openerp.com-20120713145740-xkwp0hxy7kou61f0 --- addons/web/controllers/main.py | 15 +++++++++++---- addons/web/static/src/js/chrome.js | 2 +- addons/web/static/src/js/views.js | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 412ea9abda2..c559758d3f2 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1494,10 +1494,6 @@ class Binary(openerpweb.Controller): class Action(openerpweb.Controller): _cp_path = "/web/action" - - action_mapping = { - "ir.actions.act_url": "ir.actions.url", - } # For most actions, the type attribute and the model name are the same, but # there are exceptions. This dict is used to remap action type attributes @@ -1511,6 +1507,17 @@ class Action(openerpweb.Controller): Actions = req.session.model('ir.actions.actions') value = False context = req.session.eval_context(req.context) + + try: + action_id = int(action_id) + except ValueError: + try: + module, xmlid = action_id.split('.', 1) + model, action_id = req.session.model('ir.model.data').get_object_reference(module, xmlid) + assert model.startswith('ir.actions.') + except Exception: + action_id = 0 # force failed read + base_action = Actions.read([action_id], ['type'], context) if base_action: ctx = {} diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index e4d543c69ce..67d029953a1 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -667,7 +667,7 @@ instance.web.Menu = instance.web.Widget.extend({ * @param {Number} id the action_id to match */ open_action: function (id) { - var $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id=' + id + ']'); + var $menu = this.$element.add(this.$secondary_menus).find('a[data-action-id="' + id + '"]'); var menu_id = $menu.data('menu'); if (menu_id) { this.open_menu(menu_id); diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 1bfd7d18776..1d212daaa20 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -178,7 +178,7 @@ instance.web.ActionManager = instance.web.Widget.extend({ }); }, do_action: function(action, on_close) { - if (_.isNumber(action)) { + if (_.isNumber(action) || _.isString(action)) { var self = this; return self.rpc("/web/action/load", { action_id: action }, function(result) { self.do_action(result.result, on_close); @@ -1261,7 +1261,7 @@ instance.web.View = instance.web.Widget.extend({ args.push(context); return dataset.call_button(action_data.name, args, handler); } else if (action_data.type=="action") { - return this.rpc('/web/action/load', { action_id: parseInt(action_data.name, 10), context: context, do_not_eval: true}, handler); + return this.rpc('/web/action/load', { action_id: action_data.name, context: context, do_not_eval: true}, handler); } else { return dataset.exec_workflow(record_id, action_data.name, handler); } From 51b5b750589f1b1b1e1b1770e22a965512bedd06 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 13 Jul 2012 17:01:56 +0200 Subject: [PATCH 6/8] [FIX] fp misindentation bzr revid: al@openerp.com-20120713150156-b07dd3qeff5xi3em --- addons/web/static/src/js/chrome.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 67d029953a1..f7b701f3b9d 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -86,7 +86,7 @@ instance.web.Dialog = instance.web.Widget.extend({ if (this.dialog_options.autoOpen) { this.open(); } else { - test = instance.web.dialog(this.$element, this.get_options()); + instance.web.dialog(this.$element, this.get_options()); } }, get_options: function(options) { @@ -145,9 +145,9 @@ instance.web.Dialog = instance.web.Widget.extend({ _.each(this.getChildren(), function(el) { el.destroy(); }); - if (! this.isDestroyed()) { - this.$element.dialog('destroy'); - } + if (! this.isDestroyed()) { + this.$element.dialog('destroy'); + } this._super(); } }); @@ -212,11 +212,11 @@ instance.web.CrashManager = instance.web.CallbackEnabled.extend({ dialog.$element.html(QWeb.render('CrashManager.error', {session: instance.connection, error: error})); }, on_javascript_exception: function(exception) { - this.on_traceback({ - type: _t("Client Error"), - message: exception, - data: {debug: ""} - }); + this.on_traceback({ + type: _t("Client Error"), + message: exception, + data: {debug: ""} + }); }, }); From ccde4ad6af8f63c329a6800cbd615da94e983340 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Fri, 13 Jul 2012 18:36:21 +0200 Subject: [PATCH 7/8] [FIX] declare bus class bzr revid: al@openerp.com-20120713163621-1a4mj8e01970ks44 --- addons/web/static/src/js/coresetup.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index a00ca4002e5..a5a62b9bcc1 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -404,10 +404,11 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess } }); + /** * Event Bus used to bind events scoped in the current instance */ -instance.web.bus = new (instance.web.Class.extend(instance.web.EventDispatcherMixin, { +instance.web.Bus = instance.web.Class.extend(instance.web.EventDispatcherMixin, { init: function() { instance.web.EventDispatcherMixin.init.call(this, parent); var self = this; @@ -425,7 +426,8 @@ instance.web.bus = new (instance.web.Class.extend(instance.web.EventDispatcherMi }); }); } -}))(); +}) +instance.web.bus = new instance.web.Bus(); /** OpenERP Translations */ instance.web.TranslationDataBase = instance.web.Class.extend(/** @lends instance.web.TranslationDataBase# */{ From 8f95b17d270e5ab6f67301e98e03ccb1db9fb9ee Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 14 Jul 2012 00:51:31 +0200 Subject: [PATCH 8/8] [IMP] sale order view bzr revid: fp@openerp.com-20120713225131-f5l8w42u34rvqpa4 --- addons/sale/sale.py | 12 ++++----- addons/sale/sale_view.xml | 53 ++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 611389d3d68..dba32516624 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -726,7 +726,7 @@ class sale_order(osv.osv): self.cancel_send_note(cr, uid, [sale.id], context=None) self.write(cr, uid, ids, {'state': 'cancel'}) return True - + def action_button_confirm(self, cr, uid, ids, context=None): assert len(ids) == 1, 'This option should only be used for a single id at a time' wf_service = netsvc.LocalService('workflow') @@ -1017,7 +1017,7 @@ class sale_order(osv.osv): if order_line.product_id and order_line.product_id.product_tmpl_id.type in ('product', 'consu'): return True return False - + # ------------------------------------------------ # OpenChatter methods and notifications # ------------------------------------------------ @@ -1107,7 +1107,7 @@ class sale_order_line(osv.osv): _description = 'Sales Order Line' _columns = { 'order_id': fields.many2one('sale.order', 'Order Reference', required=True, ondelete='cascade', select=True, readonly=True, states={'draft':[('readonly',False)]}), - 'name': fields.char('Description', size=256, required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), + 'name': fields.text('Product Description', size=256, required=True, select=True, readonly=True, states={'draft': [('readonly', False)]}), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of sales order lines."), 'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the shipping of the products to the customer", readonly=True, states={'draft': [('readonly', False)]}), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True), @@ -1127,7 +1127,7 @@ class sale_order_line(osv.osv): 'product_uos': fields.many2one('product.uom', 'Product UoS'), 'product_packaging': fields.many2one('product.packaging', 'Packaging'), 'move_ids': fields.one2many('stock.move', 'sale_line_id', 'Inventory Moves', readonly=True), - 'discount': fields.float('Discount (%)', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}), + 'discount': fields.float('Discount', digits=(16, 2), readonly=True, states={'draft': [('readonly', False)]}), 'number_packages': fields.function(_number_packages, type='integer', string='Number Packages'), 'notes': fields.text('Notes'), 'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}), @@ -1382,8 +1382,6 @@ class sale_order_line(osv.osv): uos = False else: uos = False - if product_obj.description_sale: - result['notes'] = product_obj.description_sale fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False if update_tax: #The quantity only have changed result['delay'] = (product_obj.sale_delay or 0.0) @@ -1392,6 +1390,8 @@ class sale_order_line(osv.osv): if not flag: result['name'] = self.pool.get('product.product').name_get(cr, uid, [product_obj.id], context=context_partner)[0][1] + if product_obj.description_sale: + result['name'] += '\n'+product_obj.description_sale domain = {} if (not uom) and (not uos): result['product_uom'] = product_obj.uom_id.id diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index acfd1516c55..60ec7e0eb45 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -189,61 +189,62 @@
+
- + - - -