From dc02b190452ded83946a7970abe3f869819e42cf Mon Sep 17 00:00:00 2001 From: vishmita Date: Fri, 11 May 2012 15:27:07 +0530 Subject: [PATCH 001/306] [FIX]when discard modification and click on next record from pager again it gives warning. lp bug: https://launchpad.net/bugs/997468 fixed bzr revid: vja@vja-desktop-20120511095707-jsqixg5c87u7itd4 --- addons/web/static/src/js/view_form.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 27606a564be..4506005d822 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -546,6 +546,7 @@ instance.web.FormView = instance.web.View.extend(_.extend({}, instance.web.form. }, on_button_cancel: function(event) { if (this.can_be_discarded()) { + this.on_record_loaded(this.datarecord); this.set({mode: "view"}); } return false; From 5b134f13b5f3a28dc4fb358d966495b75871a626 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Thu, 17 May 2012 11:14:51 +0530 Subject: [PATCH 002/306] [IMP]purchase: added a groups on filed and set topbar of state and improve a menutip bzr revid: mma@tinyerp.com-20120517054451-o3g0c8b62ug4k19m --- addons/purchase/purchase_view.xml | 42 +++++++++++-------- .../purchase/security/purchase_security.xml | 5 +++ addons/stock/stock_view.xml | 16 +++---- .../wizard/stock_partial_picking_view.xml | 4 +- 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 9743fb58a7b..3a88f18ca40 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -130,11 +130,26 @@ purchase.order form -
+ +
+
+ - + @@ -164,23 +179,11 @@ @@ -44,7 +43,7 @@ -
    +
    User img
    @@ -55,96 +54,21 @@
    -
+ -
  • - - +
    - +
  • -

    - - - - -
    -

    -

    -
    - - -

    - - - -

    -

    From:

    -

    Subject:

    -

    - - -

    - - -
    - - - -
  • -
    - - -
    - -
    - -
    -
  • - - B
      From 688ced2225e6491a78c9a100aed8ed7984a7fbc1 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 20 Jun 2012 17:54:34 +0200 Subject: [PATCH 267/306] [ADD] introduce timeago.js (check the end of mail.js) bzr revid: abo@openerp.com-20120620155434-8qos8oooxfwxkm6u --- addons/mail/static/src/js/mail.js | 192 +++++++++++++++++++++++++--- addons/mail/static/src/xml/mail.xml | 2 +- 2 files changed, 177 insertions(+), 17 deletions(-) diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 6faf8dbd40c..d3d67d0f6ee 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -5,21 +5,21 @@ openerp.mail = function(session) { var mail = session.mail = {}; /** - * Add records to sorted_comments array - * @param {Array} records records from mail.message sorted by date desc - * @returns {Object} cs comments_structure: dict - * cs.model_to_root_ids = {model: [root_ids], } - * cs.new_root_ids = [new_root_ids] - * cs.root_ids = [root_ids] - * cs.msgs = {record.id: record,} - * cs.tree_struct = {record.id: { - * 'level': record_level in hierarchy, 0 is root, - * 'msg_nbr': number of childs, - * 'direct_childs': [msg_ids], - * 'all_childs': [msg_ids], - * 'for_thread_msgs': [records], - * 'ancestors': [msg_ids], } } - */ + * Add records to sorted_comments array + * @param {Array} records records from mail.message sorted by date desc + * @returns {Object} cs comments_structure: dict + * cs.model_to_root_ids = {model: [root_ids], } + * cs.new_root_ids = [new_root_ids] + * cs.root_ids = [root_ids] + * cs.msgs = {record.id: record,} + * cs.tree_struct = {record.id: { + * 'level': record_level in hierarchy, 0 is root, + * 'msg_nbr': number of childs, + * 'direct_childs': [msg_ids], + * 'all_childs': [msg_ids], + * 'for_thread_msgs': [records], + * 'ancestors': [msg_ids], } } + */ function tools_sort_comments(cs, records, parent_id) { var cur_iter = 0; var max_iter = 10; var modif = true; while ( modif && (cur_iter++) < max_iter) { @@ -250,8 +250,10 @@ openerp.mail = function(session) { if (records.length <= self.params.limit) self.display.show_more = false; else { self.display.show_more = true; records.pop(); } - //build attachments download urls + //build attachments download urls and compute time-relative from dates for (var k in records) { + records[k].timerelative = $.timeago(records[k].date); + if (records[k].attachments) { for (var l in records[k].attachments) { records[k].attachments[l].url = self.session.origin + '/web/binary/saveas?session_id=' + self.session.session_id + '&model=ir.attachment&field=datas&filename_field=datas_fname&id='+records[k].attachments[l].id; @@ -839,6 +841,164 @@ openerp.mail = function(session) { var call_done = this.ds_users.call('message_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment', 'html']).then(this.proxy('init_and_fetch_comments')); }, }); + + /** + * Compute relative time from a date (ISO format) + * Code from http://timeago.yarp.com/ + * + * + * + * Timeago is a jQuery plugin that makes it easy to support automatically + * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). + * + * @name timeago + * @version 0.11.3 + * @requires jQuery v1.2.3+ + * @author Ryan McGeary + * @license MIT License - http://www.opensource.org/licenses/mit-license.php + * + * For usage and examples, visit: + * http://timeago.yarp.com/ + * + * Copyright (c) 2008-2012, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org) + */ + (function($) { + $.timeago = function(timestamp) { + if (timestamp instanceof Date) { + return inWords(timestamp); + } else if (typeof timestamp === "string") { + return inWords($.timeago.parse(timestamp)); + } else if (typeof timestamp === "number") { + return inWords(new Date(timestamp)); + } else { + return inWords($.timeago.datetime(timestamp)); + } + }; + var $t = $.timeago; + + $.extend($.timeago, { + settings: { + refreshMillis: 60000, + allowFuture: false, + strings: { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: "ago", + suffixFromNow: "from now", + seconds: "less than a minute", + minute: "about a minute", + minutes: "%d minutes", + hour: "about an hour", + hours: "about %d hours", + day: "a day", + days: "%d days", + month: "about a month", + months: "%d months", + year: "about a year", + years: "%d years", + wordSeparator: " ", + numbers: [] + } + }, + inWords: function(distanceMillis) { + var $l = this.settings.strings; + var prefix = $l.prefixAgo; + var suffix = $l.suffixAgo; + if (this.settings.allowFuture) { + if (distanceMillis < 0) { + prefix = $l.prefixFromNow; + suffix = $l.suffixFromNow; + } + } + + var seconds = Math.abs(distanceMillis) / 1000; + var minutes = seconds / 60; + var hours = minutes / 60; + var days = hours / 24; + var years = days / 365; + + function substitute(stringOrFunction, number) { + var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; + var value = ($l.numbers && $l.numbers[number]) || number; + return string.replace(/%d/i, value); + } + + var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || + seconds < 90 && substitute($l.minute, 1) || + minutes < 45 && substitute($l.minutes, Math.round(minutes)) || + minutes < 90 && substitute($l.hour, 1) || + hours < 24 && substitute($l.hours, Math.round(hours)) || + hours < 42 && substitute($l.day, 1) || + days < 30 && substitute($l.days, Math.round(days)) || + days < 45 && substitute($l.month, 1) || + days < 365 && substitute($l.months, Math.round(days / 30)) || + years < 1.5 && substitute($l.year, 1) || + substitute($l.years, Math.round(years)); + + var separator = $l.wordSeparator === undefined ? " " : $l.wordSeparator; + return $.trim([prefix, words, suffix].join(separator)); + }, + parse: function(iso8601) { + var s = $.trim(iso8601); + s = s.replace(/\.\d\d\d+/,""); // remove milliseconds + s = s.replace(/-/,"/").replace(/-/,"/"); + s = s.replace(/T/," ").replace(/Z/," UTC"); + s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 + return new Date(s); + }, + datetime: function(elem) { + var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); + return $t.parse(iso8601); + }, + isTime: function(elem) { + // jQuery's `is()` doesn't play well with HTML5 in IE + return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); + } + }); + + $.fn.timeago = function() { + var self = this; + self.each(refresh); + + var $s = $t.settings; + if ($s.refreshMillis > 0) { + setInterval(function() { self.each(refresh); }, $s.refreshMillis); + } + return self; + }; + + function refresh() { + var data = prepareData(this); + if (!isNaN(data.datetime)) { + $(this).text(inWords(data.datetime)); + } + return this; + } + + function prepareData(element) { + element = $(element); + if (!element.data("timeago")) { + element.data("timeago", { datetime: $t.datetime(element) }); + var text = $.trim(element.text()); + if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) { + element.attr("title", text); + } + } + return element.data("timeago"); + } + + function inWords(date) { + return $t.inWords(distance(date)); + } + + function distance(date) { + return (new Date().getTime() - date.getTime()); + } + + // fix for IE6 suckage + document.createElement("abbr"); + document.createElement("time"); + }(jQuery)); }; // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index e972e2d3f28..fe371de5728 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -97,7 +97,7 @@ · - +

      From 86b2f33f712d04a0088cf940a9858d92c329dd9e Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Wed, 20 Jun 2012 19:47:43 +0200 Subject: [PATCH 268/306] [IMP] slightly refactor timeago.js for l18n's sake bzr revid: abo@openerp.com-20120620174743-s603skiqcisu2yhm --- addons/mail/i18n/fr.po | 34 +++++++++++++++++++-- addons/mail/static/src/js/mail.js | 51 +++++++++++++++++++------------ 2 files changed, 62 insertions(+), 23 deletions(-) diff --git a/addons/mail/i18n/fr.po b/addons/mail/i18n/fr.po index 9062a02c6d4..8ac20093e62 100644 --- a/addons/mail/i18n/fr.po +++ b/addons/mail/i18n/fr.po @@ -166,17 +166,17 @@ msgstr "" #. module: mail #: view:mail.message:0 field:mail.message,state:0 msgid "State" -msgstr "" +msgstr "État" #. module: mail #: view:mail.message:0 msgid "Reply" -msgstr "" +msgstr "Répondre" #. module: mail #: view:mail.message:0 selection:mail.message,state:0 msgid "Sent" -msgstr "" +msgstr "Envoyé" #. module: mail #: help:mail.compose.message,subtype:0 help:mail.message,subtype:0 @@ -514,6 +514,34 @@ msgstr "" msgid "Preferred response address for the message" msgstr "Adresse de réponse préférée pour le message" +#. openerp-web +msgid "about a minute ago" +msgstr "il y a une minute" + +#. openerp-web +msgid "%d minutes ago" +msgstr "il y a %d minutes" + +#. openerp-web +msgid "a day ago" +msgstr "il y a un jour" + +#. openerp-web +msgid "%d days ago" +msgstr "il y a %d jours" + +#. openerp-web +msgid "a month ago" +msgstr "il y a un mois" + +#. openerp-web +msgid "%d months ago" +msgstr "il y a %d mois" + +#. openerp-web +msgid "History and Comments" +msgstr "Historique et commentaires" + #~ msgid "Text contents" #~ msgstr "Contenu du texte" diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index d3d67d0f6ee..cbc3ef518bc 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -841,10 +841,13 @@ openerp.mail = function(session) { var call_done = this.ds_users.call('message_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment', 'html']).then(this.proxy('init_and_fetch_comments')); }, }); - + + + /** * Compute relative time from a date (ISO format) * Code from http://timeago.yarp.com/ + * Please note that the library has been slightly refactored for i18n's sake. * * * @@ -910,33 +913,41 @@ openerp.mail = function(session) { suffix = $l.suffixFromNow; } } - + var seconds = Math.abs(distanceMillis) / 1000; var minutes = seconds / 60; var hours = minutes / 60; var days = hours / 24; var years = days / 365; - - function substitute(stringOrFunction, number) { + + function convert(stringOrFunction, number) { var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; - var value = ($l.numbers && $l.numbers[number]) || number; - return string.replace(/%d/i, value); + + // return the proper string and the numeric value that goes in it + return stringAndNumber = {'string': string, 'value': ($l.numbers && $l.numbers[number]) || number}; } - - var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || - seconds < 90 && substitute($l.minute, 1) || - minutes < 45 && substitute($l.minutes, Math.round(minutes)) || - minutes < 90 && substitute($l.hour, 1) || - hours < 24 && substitute($l.hours, Math.round(hours)) || - hours < 42 && substitute($l.day, 1) || - days < 30 && substitute($l.days, Math.round(days)) || - days < 45 && substitute($l.month, 1) || - days < 365 && substitute($l.months, Math.round(days / 30)) || - years < 1.5 && substitute($l.year, 1) || - substitute($l.years, Math.round(years)); - + + var stringAndNumber = seconds < 45 && convert($l.seconds, Math.round(seconds)) || + seconds < 90 && convert($l.minute, 1) || + minutes < 45 && convert($l.minutes, Math.round(minutes)) || + minutes < 90 && convert($l.hour, 1) || + hours < 24 && convert($l.hours, Math.round(hours)) || + hours < 42 && convert($l.day, 1) || + days < 30 && convert($l.days, Math.round(days)) || + days < 45 && convert($l.month, 1) || + days < 365 && convert($l.months, Math.round(days / 30)) || + years < 1.5 && convert($l.year, 1) || + convert($l.years, Math.round(years)); + + var string = stringAndNumber.string; + var value = stringAndNumber.value; var separator = $l.wordSeparator === undefined ? " " : $l.wordSeparator; - return $.trim([prefix, words, suffix].join(separator)); + + // compose and translate the final string + var finalString = $.trim([prefix, string, suffix].join(separator)); + var translatedFinalString = _.str.sprintf(_t(finalString), value); + + return translatedFinalString; }, parse: function(iso8601) { var s = $.trim(iso8601); From 040e6f52243307a2c3891832deb3c1ac5837b406 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 21 Jun 2012 09:47:17 +0200 Subject: [PATCH 269/306] [IMP] purchase: improve menu tooltips bzr revid: rco@openerp.com-20120621074717-n2nky2s6kmc2gewx --- addons/purchase/purchase_view.xml | 24 ++++++++++++++++++++---- addons/purchase/stock_view.xml | 6 +++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index fd5188ef68b..92d4150ff36 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -78,7 +78,11 @@ [('type','=','in_invoice')] {'default_type':'in_invoice', 'type':'in_invoice', 'journal_type': 'purchase', 'search_default_draft': 1} - Use this menu to control the invoices to be received from your supplier. OpenERP pregenerates draft invoices from your purchase orders or receptions, according to your settings. Once you receive a supplier invoice, you can match it with the draft invoice and validate it. + + Use this menu to control the invoices to be received from your supplier. + OpenERP generates draft invoices from your purchase orders or receptions, according to your settings. + Once you receive a supplier invoice, you can match it with the draft invoice and validate it. + {'search_default_draft': 1} tree,form,graph,calendar - You can create a request for quotation when you want to buy products to a supplier but the purchase is not confirmed yet. Use also this menu to review requests for quotation created automatically based on your logistic rules (minimum stock, MTO, etc). You can convert the request for quotation into a purchase order once the order is confirmed. If you use the extended interface (from user's preferences), you can select the way to control your supplier invoices: based on the order, based on the receptions or manual encoding. + + Create a request for quotation when you want to buy products from a supplier. + You can also use this menu to review requests for quotation created automatically + (based on logistic rules, like minimum stock, MTO, etc.) + <p> + Once confirmed, a request for quotation becomes a purchase order. + In the Purchase Settings, you can select the way to control supplier invoicing: + based on the order, based on receptions, or manual. + - Based on Purchase Order lines + Based on Purchase Order Lines ir.actions.act_window purchase.order.line [('order_id.invoice_method','<>','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)] form tree,form - If you set the Invoicing Control on a purchase order as "Based on Purchase Order lines", you can track here all the purchase order lines for which you have not yet received the supplier invoice. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu. + + Here you can track all the lines of purchase orders where the invoicing is "Based on Purchase Order Lines", + and for which you have not received a supplier invoice yet. + You can generate a draft supplier invoice based on the lines from this list. + diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml index 2d627226a6d..2d126faa9b9 100644 --- a/addons/purchase/stock_view.xml +++ b/addons/purchase/stock_view.xml @@ -108,7 +108,11 @@ [('type','=','in')] {"default_type": "in", "contact_display": "partner_address", "search_default_done": 1, "search_default_to_invoice": 1} - If you set the Invoicing Control on a purchase order as "Bases on incoming shipments", you can track here all the product receptions and create invoices for those receptions. + + Here you can track all the product receptions of purchase orders where the invoicing is "Based on Incoming Shipments", + and for which you have not received a supplier invoice yet. + You can generate a supplier invoice based on those receptions. + Date: Thu, 21 Jun 2012 10:44:36 +0200 Subject: [PATCH 270/306] [DUMMY] convert tabs to spaces in some xml files bzr revid: rco@openerp.com-20120621084436-foxhjrv81k2j6p12 --- addons/account/board_account_view.xml | 36 +++++----- addons/board/board_mydashboard_view.xml | 7 +- .../board_hr_evaluation_view.xml | 6 +- addons/project/board_project_view.xml | 66 +++++++++---------- addons/stock/board_warehouse_view.xml | 22 +++---- 5 files changed, 68 insertions(+), 69 deletions(-) diff --git a/addons/account/board_account_view.xml b/addons/account/board_account_view.xml index aa55bd6df44..913e43e5982 100644 --- a/addons/account/board_account_view.xml +++ b/addons/account/board_account_view.xml @@ -2,25 +2,25 @@ - - Company Analysis - account.entries.report - form - tree,graph - {'group_by':['user_type'], 'group_by_no_leaf':1} - - [('year','=',time.strftime('%Y'))] - + + Company Analysis + account.entries.report + form + tree,graph + {'group_by':['user_type'], 'group_by_no_leaf':1} + + [('year','=',time.strftime('%Y'))] + - - Treasury - account.account - form - graph,tree - [('type','=','liquidity')] - {'default_type': 'liquidity'} - - + + Treasury + account.account + form + graph,tree + [('type','=','liquidity')] + {'default_type': 'liquidity'} + + board.account.form diff --git a/addons/board/board_mydashboard_view.xml b/addons/board/board_mydashboard_view.xml index adb64cf32e5..ecef1aaee98 100644 --- a/addons/board/board_mydashboard_view.xml +++ b/addons/board/board_mydashboard_view.xml @@ -1,6 +1,6 @@ - + My Dashboard @@ -15,7 +15,7 @@ - + My Dashboard @@ -32,8 +32,7 @@ there or not. Drag and Drop to organize them in the sequence you want. You can Remove any board by clicking cross button. - - + form - - - + + + diff --git a/addons/project/board_project_view.xml b/addons/project/board_project_view.xml index 7eccec9510c..09a7fe57bab 100644 --- a/addons/project/board_project_view.xml +++ b/addons/project/board_project_view.xml @@ -2,40 +2,40 @@ - - project.vs.remaining.hour.tree - project.vs.hours - tree - - - - - - - - + + project.vs.remaining.hour.tree + project.vs.hours + tree + + + + + + + + - - project.vs.remaining.hour.graph - project.vs.hours - graph - - - - - - - - + + project.vs.remaining.hour.graph + project.vs.hours + graph + + + + + + + + - - Remaining Hours Per Project - project.vs.hours - form - graph,tree - [('user_id','=',uid),('state','not in',('cancel','done'))] - - + + Remaining Hours Per Project + project.vs.hours + form + graph,tree + [('user_id','=',uid),('state','not in',('cancel','done'))] + + project.task.tree @@ -43,7 +43,7 @@ tree - + diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index 40473abd041..1c416287e84 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -3,17 +3,17 @@ - report.stock.move.graph - report.stock.move - graph - - - - - - - - + report.stock.move.graph + report.stock.move + graph + + + + + + + + Incoming Shipments From fbf7e6ff82a72826852061a230370fcb9d8e9fd4 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Thu, 21 Jun 2012 11:16:58 +0200 Subject: [PATCH 271/306] [IMP] board: improve tooltip bzr revid: rco@openerp.com-20120621091658-chvg3ipwvm7caskn --- addons/board/board_mydashboard_view.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/board/board_mydashboard_view.xml b/addons/board/board_mydashboard_view.xml index ecef1aaee98..7a517c36ed7 100644 --- a/addons/board/board_mydashboard_view.xml +++ b/addons/board/board_mydashboard_view.xml @@ -24,12 +24,14 @@ form menu - To customize your dashboard. -Go to any view of the OpenERP, apply any of available filters and click to -'Add to Dashboard' through the search options. -Now return to your Dashboard and check if the board you have just added is -there or not. Drag and Drop to organize them in the sequence you want. -You can Remove any board by clicking cross button. + + This is your personal dashboard. + To customize it, go to any view in OpenERP, fill in the desired search filter, + and click on 'Add to Dashboard' in the search options. + The view will appear as an element in your dashboard. + <p> + You can drag and drop the elements to get your preferred dashboard layout. + Click on the cross (in the upper right corner) to remove an element. From 04448834bab55b53da17314a7400020ec3831a66 Mon Sep 17 00:00:00 2001 From: "Sbh (Openerp)" Date: Thu, 21 Jun 2012 14:54:49 +0530 Subject: [PATCH 272/306] [REVERT] revert changes of test_osv_expression.yml bzr revid: sbh@tinyerp.com-20120621092449-bz1bzdadrl13t50j --- .../addons/base/test/test_osv_expression.yml | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/openerp/addons/base/test/test_osv_expression.yml b/openerp/addons/base/test/test_osv_expression.yml index 0165b61b275..0fe6c98c359 100644 --- a/openerp/addons/base/test/test_osv_expression.yml +++ b/openerp/addons/base/test/test_osv_expression.yml @@ -75,7 +75,7 @@ Trying the "in" operator, for scalar value - !python {model: res.partner }: | - ids = self.search(cr, uid, [('parent_id','=','Agrolait')]) + ids = self.search(cr, uid, [('parent_id','in','Agrolait')]) assert len(ids) >= 1, ids - Trying the "in" operator for list value @@ -229,7 +229,7 @@ res_0.sort() res_1 = self.search(cr, uid, [('parent_id', 'not in', [max_partner_id + 1])]) # get all rows, included null parent_id res_1.sort() - res_2 = self.search(cr, uid, [('parent_id', '!=', False)]) # get rows with not null parent_id, deprecated syntax + res_2 = self.search(cr, uid, [('parent_id', 'not in', False)]) # get rows with not null parent_id, deprecated syntax res_2.sort() res_3 = self.search(cr, uid, [('parent_id', 'not in', [])]) # get all rows, included null parent_id res_3.sort() @@ -249,7 +249,7 @@ res_5.sort() res_6 = self.search(cr, uid, [('parent_id', 'in', [max_partner_id + 1])]) res_6.sort() - res_7 = self.search(cr, uid, [('parent_id', '=', False)]) + res_7 = self.search(cr, uid, [('parent_id', 'in', False)]) res_7.sort() res_8 = self.search(cr, uid, [('parent_id', 'in', [])]) res_8.sort() @@ -270,7 +270,7 @@ res_10.sort() res_11 = self.search(cr, uid, ['!', ('parent_id', 'in', [max_partner_id + 1])]) res_11.sort() - res_12 = self.search(cr, uid, ['!', ('parent_id', '=', False)]) + res_12 = self.search(cr, uid, ['!', ('parent_id', 'in', False)]) res_12.sort() res_13 = self.search(cr, uid, ['!', ('parent_id', 'in', [])]) res_13.sort() @@ -291,7 +291,7 @@ res_16.sort() assert res_16 == partner_ids - res_17 = self.search(cr, uid, [('website', '!=', False)]) + res_17 = self.search(cr, uid, [('website', 'not in', False)]) res_17.sort() assert res_17 == with_website @@ -306,21 +306,21 @@ assert res_101 == [], 'res_101: expected %r, got %r' % ([], res_101) assert res_102 == company_ids, 'res_102: expected %r, got %r' % (company_ids, res_102) - - Property of the query (one2many != False). + Property of the query (one2many not in False). - !python {model: res.currency }: | ids = self.search(cr, uid, []) referenced_companies = set([x.company_id.id for x in self.browse(cr, uid, ids)]) - companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', '!=', False)])) + companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', 'not in', False)])) assert referenced_companies == companies - - Property of the query (one2many = False). + Property of the query (one2many in False). - !python {model: res.currency }: | ids = self.search(cr, uid, []) referenced_companies = set([x.company_id.id for x in self.browse(cr, uid, ids)]) unreferenced_companies = set(self.pool.get('res.company').search(cr, uid, [])).difference(referenced_companies) - companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', '=', False)])) + companies = set(self.pool.get('res.company').search(cr, uid, [('currency_ids', 'in', False)])) assert unreferenced_companies == companies - Equivalent queries. @@ -331,7 +331,7 @@ res_1 = self.search(cr, uid, [('name', 'not like', 'probably_unexisting_name')]) res_2 = self.search(cr, uid, [('id', 'not in', [max_currency_id + 1003])]) res_3 = self.search(cr, uid, [('id', 'not in', [])]) - res_4 = self.search(cr, uid, [('id', '!=', False)]) + res_4 = self.search(cr, uid, [('id', 'not in', False)]) res_0.sort() res_1.sort() res_2.sort() @@ -414,7 +414,7 @@ # get the companies referenced by some currency (this is normally the main company) res_10 = self.search(cr, uid, [('currency_ids', 'not like', 'probably_unexisting_name')]) res_11 = self.search(cr, uid, [('currency_ids', 'not in', [max_currency_id + 1])]) - res_12 = self.search(cr, uid, [('currency_ids', '!=', False)]) + res_12 = self.search(cr, uid, [('currency_ids', 'not in', False)]) res_13 = self.search(cr, uid, [('currency_ids', 'not in', [])]) res_10.sort() res_11.sort() @@ -526,5 +526,3 @@ !python {model: res.partner }: | res_ids = self.search(cr, uid, [('child_ids.country_id','=','Belgium'),('active','=',False)]) assert len(res_ids) != 0, "Record not Found with country Belgium and active False." - - From 938a3e23683cab8c26b58ecb98166392802609a3 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 11:27:04 +0200 Subject: [PATCH 273/306] [FIX] Remove useless css in calendar causing problems to overlays bzr revid: fme@openerp.com-20120621092704-kt53w579gut24vn0 --- addons/web_calendar/static/src/css/web_calendar.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/web_calendar/static/src/css/web_calendar.css b/addons/web_calendar/static/src/css/web_calendar.css index 18eec963866..b7008a5bd91 100644 --- a/addons/web_calendar/static/src/css/web_calendar.css +++ b/addons/web_calendar/static/src/css/web_calendar.css @@ -37,14 +37,6 @@ -moz-user-select:-moz-none; } -.openerp .dhx_cal_navline{ - height:20px; - position:absolute; - z-index:1; - width:750px; - color:#2F3A48; - background-color:#eee; -} .openerp .dhx_cal_navline div{ top:2px; white-space:nowrap; From 47589848ba3343f1b167192f95b73ffd44028096 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 11:29:43 +0200 Subject: [PATCH 274/306] [FIX] Fixed oe_edit_only bzr revid: fme@openerp.com-20120621092943-rrc94sjoobybhjxk --- addons/web/static/src/css/base.css | 3 --- addons/web/static/src/css/base.sass | 2 -- 2 files changed, 5 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 5c34e40ec7f..e381ca5b573 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1526,9 +1526,6 @@ .openerp .oe_form_invisible { display: none !important; } -.openerp .oe_form_editable .oe_edit_only { - display: none !important; -} .openerp .oe_form_readonly .oe_edit_only, .openerp .oe_form_readonly .oe_form_field:empty { display: none !important; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 0b1d22e5345..7b54f079ddb 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1218,8 +1218,6 @@ $colour4: #8a89ba background: #ED6F6A .oe_form_invisible display: none !important - .oe_form_editable .oe_edit_only - display: none !important .oe_form_readonly .oe_edit_only, .oe_form_field:empty display: none !important From c7ea0c3761e6a4be80209f4f1b0b8798cf4bded6 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 11:55:23 +0200 Subject: [PATCH 275/306] [IMP] Code styling bzr revid: fme@openerp.com-20120621095523-tfc8r2pan80f9a3i --- addons/web_dashboard/static/src/js/dashboard.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web_dashboard/static/src/js/dashboard.js b/addons/web_dashboard/static/src/js/dashboard.js index a27c5f30bb5..e08113d02ab 100644 --- a/addons/web_dashboard/static/src/js/dashboard.js +++ b/addons/web_dashboard/static/src/js/dashboard.js @@ -231,14 +231,14 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ } }, renderElement: function() { - var self = this; var check = _.detect(this.node.children, function(column, column_index) { return _.detect(column.children,function(element){ return element.tag === "action"? element: false; }); }); - if (!check) - return self.no_result(); + if (!check) { + return this.no_result(); + } // We should start with three columns available for (var i = this.node.children.length; i < 3; i++) { this.node.children.push({ @@ -250,8 +250,8 @@ instance.web.form.DashBoard = instance.web.form.FormWidget.extend({ var rendered = QWeb.render(this.form_template, this); this.$element.html(rendered); }, - no_result: function () { - if (this.view.options.action.help){ + no_result: function() { + if (this.view.options.action.help) { this.$element.append( $('
      ') .append($('', { src: '/web_dashboard/static/src/img/view_todo_arrow.png' })) From 2a640918c7332c8102793706531015ebfd417672 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 21 Jun 2012 13:19:33 +0200 Subject: [PATCH 276/306] [FIX] potential problem with create & edit in m2o, it should not set a default_name bzr revid: nicolas.vanhoren@openerp.com-20120621111933-s9wmabv4bh8p7n1n --- addons/web/static/src/js/view_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 12651148a0c..9a2b2b8bdb1 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2409,7 +2409,7 @@ instance.web.form.CompletionFieldMixin = { } // create... values.push({label: _t("   Create and Edit..."), action: function() { - self._search_create_popup("form", undefined, {"default_name": search_val}); + self._search_create_popup("form", undefined, {}); }}); return values; From 7a48f76737f3b4d90935b1546236139ec144cb3c Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 13:34:45 +0200 Subject: [PATCH 277/306] [FIX] Fixed oe_form_field_boolean css bzr revid: fme@openerp.com-20120621113445-u7gx1ztrwxc7tn5d --- addons/web/static/src/css/base.css | 1 + addons/web/static/src/css/base.sass | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index e381ca5b573..05217f8e10a 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1806,6 +1806,7 @@ } .openerp .oe_form .oe_form_field_boolean { padding-top: 4px; + width: auto; } .openerp .oe_form .oe_form_field_many2manytags .text-wrap { width: 100% !important; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 7b54f079ddb..c34cec6b1b1 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1438,6 +1438,7 @@ $colour4: #8a89ba white-space: nowrap .oe_form_field_boolean padding-top: 4px + width: auto .oe_form_field_many2manytags .text-wrap width: 100% !important From c8e5450ba3a0976b84777a89b4e1142abbf7af13 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Thu, 21 Jun 2012 14:48:43 +0200 Subject: [PATCH 278/306] [IMP] use the default openerp dropdown menu implementation. also improve markup (ul.oe_mail_wall_threads is now a list of li.oe_mail_wall_thread) more markup and css improvements to come bzr revid: abo@openerp.com-20120621124843-klk1oy2rxdcd08uh --- addons/mail/static/src/css/mail.css | 78 ++++------------------------- addons/mail/static/src/js/mail.js | 14 +++--- addons/mail/static/src/xml/mail.xml | 31 ++++++------ 3 files changed, 34 insertions(+), 89 deletions(-) diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 2a253154fde..41f1331ef6f 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -170,7 +170,7 @@ margin-left: 66px; } -.openerp div.oe_mail_thread_subthread li.oe_mail_thread_msg:last-child { +.openerp div.oe_mail_thread_subthread .oe_mail_thread_msg:last-child { margin-bottom: 8px; } @@ -179,13 +179,13 @@ border-bottom: 1px solid #D2D9E7; } -.openerp li.oe_mail_thread_msg:after { +.openerp .oe_mail_thread_msg:after { content: ""; display: block; clear: both; } -.openerp li.oe_mail_thread_msg > div:after { +.openerp .oe_mail_thread_msg > div:after { content: ""; display: block; clear: both; @@ -246,15 +246,6 @@ /* Styling (should be openerp) */ /* ------------------------------ */ -.openerp ul.oe_mail { - padding: 0; - margin: 0; -} - -.openerp li.oe_mail { - list-style-type: none; -} - .openerp input.oe_mail, textarea.oe_mail { width: 432px; padding: 4px; @@ -291,7 +282,7 @@ } /* ------------------------------ */ -/* New layouts' style */ +/* Messages layout */ /* ------------------------------ */ .openerp .oe_mail_msg .oe_mail_msg_title { @@ -325,64 +316,20 @@ font-weight: bold; } -/* Gear menu */ -.openerp .oe_mail_msg_content a.oe_gear_menuaction { +/* Dropdown menu */ +.openerp .oe_mail_msg_content .oe_dropdown_toggle { position: absolute; top: 0px; right: 3px; - display: none; - color: #4c4c4c; - cursor: pointer; } -.openerp .oe_mail_msg_content:hover .oe_gear_menuaction { - display: block; +.openerp .oe_mail_msg_content .oe_dropdown_arrow:after { + border-top: 4px solid transparent; } -.openerp .oe_mail_msg_content a.oe_gear_menuaction:hover { - text-decoration: none; -} -.openerp .oe_mail_msg_content ul.oe_gear_menu { - list-style-type: none; - display: none; - position: absolute; - top: 30px; - right: -140px; - padding: 4px; - border: 1px solid #afafb6; - min-width: 160px; - overflow-x: hidden; - z-index: 900; - background: white; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - border-radius: 3px; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); - -box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); -} -.openerp .oe_mail_msg_content ul.oe_gear_menu > li { - float: none; -} -.openerp .oe_mail_msg_content .oe_gear_menu > li > a { - display: block; - padding: 3px 6px; - line-height: 14px; - color: #4c4c4c; - text-decoration: none; -} -.openerp .oe_mail_msg_content .oe_gear_menu > li > a:hover { - background: #f0f0fa; - background: -moz-linear-gradient(#f0f0fa, #eeeef6); - background: -webkit-gradient(linear, left top, left bottom, from(#f0f0fa), to(#eeeef6)); - background: -webkit-linear-gradient(#f0f0fa, #eeeef6); - -moz-box-shadow: none; - -webkit-box-shadow: none; - -box-shadow: none; -} -.openerp .oe_mail_msg_content .oe_gear_menu p { - margin-left: 12px; +.openerp .oe_mail_msg_content:hover .oe_dropdown_arrow:after { + border-top: 4px solid #404040; } -/* Attachments */ +/* Attachments list */ .openerp ul.oe_mail_msg_attachments { display: none; width: 100%; @@ -397,6 +344,3 @@ padding: 0; list-style-type: square; } - - - diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index cbc3ef518bc..9b209c137a2 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -182,7 +182,7 @@ openerp.mail = function(session) { var msg_id = event.srcElement.dataset.id; if (! msg_id) return false; var call_defer = self.ds_msg.unlink([parseInt(msg_id)]); - $(event.srcElement).parents('li.oe_mail_thread_msg').eq(0).hide(); + $(event.srcElement).parents('.oe_mail_thread_msg').eq(0).hide(); if (self.params.thread_level > 0) { $(event.srcElement).parents('ul.oe_mail_thread').eq(0).hide(); } @@ -196,9 +196,9 @@ openerp.mail = function(session) { if (! msg_id) return false; //console.log(msg_id); var call_defer = self.ds.call('message_remove_pushed_notifications', [[self.params.res_id], [parseInt(msg_id)], true]); - $(event.srcElement).parents('li.oe_mail_thread_msg').eq(0).hide(); + $(event.srcElement).parents('.oe_mail_thread_msg').eq(0).hide(); if (self.params.thread_level > 0) { - $(event.srcElement).parents('ul.oe_mail_thread').eq(0).hide(); + $(event.srcElement).parents('.oe_mail_thread').eq(0).hide(); } return false; }); @@ -300,7 +300,7 @@ openerp.mail = function(session) { self.display_comment(record); self.thread = new mail.Thread(self, {'res_model': self.params.res_model, 'res_id': self.params.res_id, 'uid': self.params.uid, 'records': sub_msgs, 'thread_level': (self.params.thread_level-1), 'parent_id': record.id}); - self.$element.find('li.oe_mail_thread_msg:last').append('
      '); + self.$element.find('.oe_mail_thread_msg:last').append('
      '); self.thread.appendTo(self.$element.find('div.oe_mail_thread_subthread:last')); } else if (self.params.thread_level == 0) { @@ -749,7 +749,7 @@ openerp.mail = function(session) { this.search['context'] = _.extend(this.params.context, this.search_results.context); this.display_show_more = true; this.comments_structure = {'root_ids': [], 'new_root_ids': [], 'msgs': {}, 'tree_struct': {}, 'model_to_root_ids': {}}; - this.$element.find('div.oe_mail_wall_threads').empty(); + this.$element.find('ul.oe_mail_wall_threads').empty(); return this.fetch_comments(this.params.limit, 0); }, @@ -782,13 +782,13 @@ openerp.mail = function(session) { var model_name = self.comments_structure.msgs[root_id]['model']; var res_id = self.comments_structure.msgs[root_id]['res_id']; var render_res = session.web.qweb.render('WallThreadContainer', {}); - $('
      ').html(render_res).appendTo(self.$element.find('div.oe_mail_wall_threads')); + $('
    • ').html(render_res).appendTo(self.$element.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(self, { 'res_model': model_name, 'res_id': res_id, 'uid': self.session.uid, 'records': records, 'parent_id': false, 'thread_level': self.params.thread_level, 'show_hide': true} ); self.thread_list.push(thread); - return thread.appendTo(self.$element.find('div.oe_mail_wall_thread:last')); + return thread.appendTo(self.$element.find('li.oe_mail_wall_thread:last')); }); // update TODO this.comments_structure['root_ids'] = _.union(this.comments_structure['root_ids'], this.comments_structure['new_root_ids']); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index fe371de5728..a5d669a4f00 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -15,8 +15,8 @@
    • -
      -
      +
        +
      @@ -57,7 +57,7 @@
      -
    • +
      @@ -66,22 +66,23 @@
      -
    • +
      - B - +
      From e65eeb26b808881562ccf372b947c455b6cfdd6d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 15:07:58 +0200 Subject: [PATCH 279/306] [FIX] Fixed oe_inline. WARNING: We're using too much !important's bzr revid: fme@openerp.com-20120621130758-dgr0n3uksq4o1uh2 --- addons/web/static/src/css/base.css | 4 ++-- addons/web/static/src/css/base.sass | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 05217f8e10a..1bc566db860 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -215,8 +215,8 @@ .openerp .oe_bold { font-weight: bold; } -.openerp .oe_inline  { - width: auto; +.openerp .oe_inline { + width: auto !important; } .openerp .oe_highlight { color: white; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c34cec6b1b1..07026bc69d1 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -220,8 +220,8 @@ $colour4: #8a89ba color: #888 .oe_bold font-weight: bold - .oe_inline  - width: auto + .oe_inline + width: auto !important .oe_highlight color: white background: #DC5F59 From f91d828ef55e018096f71b5ee553a944881551a4 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 15:47:44 +0200 Subject: [PATCH 280/306] [FIX] Removed duplicate field in tasks form view bzr revid: fme@openerp.com-20120621134744-7qiwzfxcim8p0ba9 --- addons/project/project_view.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index d9cba469bc4..7588de7348f 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -361,7 +361,6 @@ - From e0f324ac25b0f89065c39bec8b6d216f0365009d Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 21 Jun 2012 16:06:42 +0200 Subject: [PATCH 281/306] [FIX] field text width bzr revid: fme@openerp.com-20120621140642-s96lwuycykbxo719 --- addons/web/static/src/css/base.css | 2 +- addons/web/static/src/css/base.sass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 1bc566db860..b5276c982d6 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1720,7 +1720,7 @@ .openerp .oe_form .oe_form_field_selection select { width: inherit; } -.openerp .oe_form .oe_form_sheet textarea { +.openerp .oe_form .oe_form_field_text.oe_inline, .openerp .oe_form .oe_form_field_text.oe_inline > textarea { width: 500px; } .openerp .oe_form .oe_form_field_float input { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 07026bc69d1..4db214a7a48 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1378,7 +1378,7 @@ $colour4: #8a89ba .oe_form_field_text textarea, .oe_form_field_selection select width: inherit - .oe_form_sheet textarea + .oe_form_field_text.oe_inline, .oe_form_field_text.oe_inline > textarea width: 500px .oe_form_field_float input width: 100px From b821d42061465fe6f49449cecc2e87c2b57079da Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Thu, 21 Jun 2012 17:00:02 +0200 Subject: [PATCH 282/306] [IMP] properly prefix templates names with 'mail.' use 'main' and 'aside' instead of 'left' and 'right' in the mail main boxes' class names bzr revid: abo@openerp.com-20120621150002-u7saes5bc06bt51l --- addons/mail/static/src/css/mail.css | 69 ++++++++++++++++++----------- addons/mail/static/src/js/mail.js | 20 ++++----- addons/mail/static/src/xml/mail.xml | 16 +++---- 3 files changed, 60 insertions(+), 45 deletions(-) diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css index 41f1331ef6f..e9b2b8ebd79 100644 --- a/addons/mail/static/src/css/mail.css +++ b/addons/mail/static/src/css/mail.css @@ -9,35 +9,19 @@ background: white; } -.openerp div.oe_mail_wall_act { +.openerp div.oe_mail_wall_action { padding: 8px; background: #eee; border: 1px solid #ccc; } -.openerp div.oe_mail_wall_act:after { +.openerp div.oe_mail_wall_action:after { content: ""; display: block; clear: both; } -/* 2 columns view */ -.openerp div.oe_mail_wall_left { - float: left; - width: 560px; - margin: 8px; -} - -.openerp div.oe_mail_wall_right { - margin-left: 565px; - margin: 8px; -} - -.openerp div.oe_mail_wall_threads { - margin-top: 8px; -} - -.openerp textarea.oe_mail_wall_action_textarea { +.openerp .oe_mail_wall_action textarea { width: 474px; height: 60px; padding: 4px; @@ -45,11 +29,31 @@ float: right; } -.openerp div.oe_mail_wall_threads textarea { +/* 2 columns view */ +.openerp div.oe_mail_wall_main { + float: left; + width: 560px; + margin: 8px; +} + +.openerp div.oe_mail_wall_aside { + margin-left: 565px; + margin: 8px; +} + +/* Threads */ +.openerp .oe_mail_wall_threads { + margin-top: 8px; +} +.openerp .oe_mail_wall_threads textarea { height: 40px; padding: 4px; } +.openerp .oe_mail_wall_thread:first .oe_mail_msg_notification { + border-top: 0; +} + .openerp div.oe_mail_thread_subthread img { width: 28px; height: 28px; @@ -149,14 +153,14 @@ /* ThreadDisplay */ /* ------------------------------ */ -.openerp div.oe_mail_thread_act { +.openerp div.oe_mail_thread_action { white-space: normal; padding: 8px; background: #eee; - border-top: 1px solid #ccc + border-top: 1px solid #ccc; } -.openerp div.oe_mail_thread_act:after { +.openerp div.oe_mail_thread_action:after { content: ""; display: block; clear: both; @@ -191,13 +195,22 @@ clear: both; } -.openerp .oe_mail_msg_notification, .openerp .oe_mail_msg_comment, .openerp .oe_mail_msg_email { +.openerp .oe_mail_msg_notification, +.openerp .oe_mail_msg_comment, +.openerp .oe_mail_msg_email { padding: 8px; } -.openerp .oe_mail_msg_comment, .openerp .oe_mail_msg_email, .openerp .oe_mail_msg_notification { +.openerp .oe_mail_msg_comment, +.openerp .oe_mail_msg_email, +.openerp .oe_mail_msg_notification { background: white; - border-top: 1px solid #ccc + border-top: 1px solid #ccc; +} +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_comment, +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_email, +.openerp .oe_mail_wall_threads > .oe_mail_wall_thread:first-child > .oe_mail_msg_notification { + border-top: 0; } .openerp .oe_email_icon { @@ -209,7 +222,9 @@ background: #eee; } -.openerp .oe_mail_msg_notification:after, .openerp .oe_mail_msg_comment:after, .openerp .oe_mail_msg_email:after { +.openerp .oe_mail_msg_notification:after, +.openerp .oe_mail_msg_comment:after, +.openerp .oe_mail_msg_email:after { content: ""; display: block; clear: both; diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 9b209c137a2..7339af7c612 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -72,7 +72,7 @@ openerp.mail = function(session) { * either it will fetch [limit] messages related to [res_model]:[res_id]. */ mail.Thread = session.web.Widget.extend({ - template: 'Thread', + template: 'mail.Thread', /** * @param {Object} parent parent @@ -122,7 +122,7 @@ openerp.mail = function(session) { this._super.apply(this, arguments); // customize display if (! this.display.show_post_comment) { - this.$element.find('div.oe_mail_thread_act').hide(); + this.$element.find('div.oe_mail_thread_action').hide(); } // add events this.add_events(); @@ -171,7 +171,7 @@ openerp.mail = function(session) { }); // event: click on 'reply' in msg this.$element.find('div.oe_mail_thread_display').delegate('a.oe_mail_msg_reply', 'click', function (event) { - var act_dom = $(this).parents('div.oe_mail_thread_display').find('div.oe_mail_thread_act:first'); + var act_dom = $(this).parents('div.oe_mail_thread_display').find('div.oe_mail_thread_action:first'); act_dom.toggle(); event.preventDefault(); }); @@ -184,7 +184,7 @@ openerp.mail = function(session) { var call_defer = self.ds_msg.unlink([parseInt(msg_id)]); $(event.srcElement).parents('.oe_mail_thread_msg').eq(0).hide(); if (self.params.thread_level > 0) { - $(event.srcElement).parents('ul.oe_mail_thread').eq(0).hide(); + $(event.srcElement).parents('.oe_mail_thread').eq(0).hide(); } return false; }); @@ -539,7 +539,7 @@ openerp.mail = function(session) { /* ThreadView widget: thread of comments */ mail.RecordThread = session.web.form.AbstractField.extend({ // QWeb template to use when rendering the object - template: 'RecordThread', + template: 'mail.RecordThread', init: function() { this._super.apply(this, arguments); @@ -581,7 +581,7 @@ openerp.mail = function(session) { this._super.apply(this, arguments); var self = this; this.reinit(); - if (! this.view.datarecord.id) { this.$element.find('ul.oe_mail_thread').hide(); return; } + if (! this.view.datarecord.id) { this.$element.find('.oe_mail_thread').hide(); return; } // fetch followers var fetch_sub_done = this.fetch_subscribers(); // create and render Thread widget @@ -645,7 +645,7 @@ openerp.mail = function(session) { /* WallView widget: a wall of messages */ mail.WallView = session.web.Widget.extend({ - template: 'Wall', + template: 'mail.Wall', /** * @param {Object} parent parent @@ -695,7 +695,7 @@ openerp.mail = function(session) { add_event_handlers: function () { var self = this; // post a comment - this.$element.find('button.oe_mail_wall_button_comment').click(function () { return self.do_comment(); }); + this.$element.find('.oe_mail_wall_action button').click(function () { return self.do_comment(); }); // display more threads this.$element.find('button.oe_mail_wall_button_more').click(function () { return self.do_more(); }); }, @@ -781,7 +781,7 @@ openerp.mail = function(session) { var records = self.comments_structure.tree_struct[root_id]['for_thread_msgs']; var model_name = self.comments_structure.msgs[root_id]['model']; var res_id = self.comments_structure.msgs[root_id]['res_id']; - var render_res = session.web.qweb.render('WallThreadContainer', {}); + var render_res = session.web.qweb.render('mail.WallThreadContainer', {}); $('
    • ').html(render_res).appendTo(self.$element.find('ul.oe_mail_wall_threads')); var thread = new mail.Thread(self, { 'res_model': model_name, 'res_id': res_id, 'uid': self.session.uid, 'records': records, @@ -835,7 +835,7 @@ openerp.mail = function(session) { /** Action: Posts a comment */ do_comment: function () { - var comment_node = this.$element.find('textarea.oe_mail_wall_action_textarea'); + var comment_node = this.$element.find('.oe_mail_wall_action textarea'); var body_text = comment_node.val(); comment_node.val(''); var call_done = this.ds_users.call('message_append_note', [[this.session.uid], 'Tweet', body_text, false, 'comment', 'html']).then(this.proxy('init_and_fetch_comments')); diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml index a5d669a4f00..7f74f3f5d80 100644 --- a/addons/mail/static/src/xml/mail.xml +++ b/addons/mail/static/src/xml/mail.xml @@ -1,15 +1,15 @@