diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index d7561130feb..07ad37923d8 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -345,7 +345,13 @@ def make_conditional(req, response, last_modified=None, etag=None): return response.make_conditional(req.httprequest) def login_and_redirect(req, db, login, key, redirect_url='/'): - req.session.authenticate(db, login, key, {}) + wsgienv = req.httprequest.environ + env = dict( + base_location=req.httprequest.url_root.rstrip('/'), + HTTP_HOST=wsgienv['HTTP_HOST'], + REMOTE_ADDR=wsgienv['REMOTE_ADDR'], + ) + req.session.authenticate(db, login, key, env) return set_cookie_and_redirect(req, redirect_url) def set_cookie_and_redirect(req, redirect_url): @@ -1746,7 +1752,9 @@ class Export(View): def fields_info(self, req, model, export_fields): info = {} fields = self.fields_get(req, model) - + if ".id" in export_fields: + fields['.id'] = fields.pop('id', {'string': 'ID'}) + # To make fields retrieval more efficient, fetch all sub-fields of a # given field at the same time. Because the order in the export list is # arbitrary, this requires ordering all sub-fields of a given field diff --git a/addons/web/i18n/fr.po b/addons/web/i18n/fr.po index fdc3c87a399..13b15a63c62 100644 --- a/addons/web/i18n/fr.po +++ b/addons/web/i18n/fr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2012-07-02 09:06+0200\n" -"PO-Revision-Date: 2012-02-15 10:35+0000\n" -"Last-Translator: Olivier Dony (OpenERP) \n" +"PO-Revision-Date: 2012-11-21 16:26+0000\n" +"Last-Translator: Quentin THEURET \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-11-15 05:08+0000\n" -"X-Generator: Launchpad (build 16265)\n" +"X-Launchpad-Export-Date: 2012-11-22 05:15+0000\n" +"X-Generator: Launchpad (build 16293)\n" #. openerp-web #: addons/web/static/src/js/chrome.js:176 @@ -129,29 +129,29 @@ msgstr "OpenERP - Version communautaire/non supportée" #. openerp-web #: addons/web/static/src/js/coresetup.js:619 msgid "less than a minute ago" -msgstr "" +msgstr "il y a moins d'une minute" #. openerp-web #: addons/web/static/src/js/coresetup.js:620 msgid "about a minute ago" -msgstr "" +msgstr "il y a une minute" #. openerp-web #: addons/web/static/src/js/coresetup.js:621 #, python-format msgid "%d minutes ago" -msgstr "" +msgstr "il y a %d minutes" #. openerp-web #: addons/web/static/src/js/coresetup.js:622 msgid "about an hour ago" -msgstr "" +msgstr "il y a une heure" #. openerp-web #: addons/web/static/src/js/coresetup.js:623 #, python-format msgid "%d hours ago" -msgstr "" +msgstr "il y a %d heures" #. openerp-web #: addons/web/static/src/js/coresetup.js:624 @@ -162,23 +162,23 @@ msgstr "" #: addons/web/static/src/js/coresetup.js:625 #, python-format msgid "%d days ago" -msgstr "" +msgstr "il y a %d jours" #. openerp-web #: addons/web/static/src/js/coresetup.js:626 msgid "about a month ago" -msgstr "" +msgstr "il y a un mois" #. openerp-web #: addons/web/static/src/js/coresetup.js:627 #, python-format msgid "%d months ago" -msgstr "" +msgstr "il y a %d mois" #. openerp-web #: addons/web/static/src/js/coresetup.js:628 msgid "about a year ago" -msgstr "" +msgstr "il y a un an" #. openerp-web #: addons/web/static/src/js/coresetup.js:629 @@ -243,17 +243,19 @@ msgid "" "Destination fields should only be selected once, some fields are selected " "more than once:" msgstr "" +"Les champs de destination ne devraient être sélectionnés qu'une seule fois, " +"plusieurs champs ont été sélectionnés plusieurs fois:" #. openerp-web #: addons/web/static/src/js/data_import.js:386 msgid "*Required Fields are not selected :" -msgstr "" +msgstr "*Les champs requis ne sont pas sélectionnés :" #. openerp-web #: addons/web/static/src/js/formats.js:139 #, python-format msgid "(%d records)" -msgstr "" +msgstr "(%d enregistrements)" #. openerp-web #: addons/web/static/src/js/formats.js:325 @@ -1120,7 +1122,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:523 msgid "/web/binary/upload_attachment" -msgstr "" +msgstr "/web/binary/upload_attachment" #. openerp-web #: addons/web/static/src/xml/base.xml:527 @@ -1136,7 +1138,7 @@ msgstr "" #. openerp-web #: addons/web/static/src/xml/base.xml:687 msgid "Discard" -msgstr "" +msgstr "Annuler" #. openerp-web #: addons/web/static/src/xml/base.xml:806 diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js index 71a9628eff2..5c076112eb0 100644 --- a/addons/web/static/lib/qweb/qweb2.js +++ b/addons/web/static/lib/qweb/qweb2.js @@ -698,7 +698,7 @@ QWeb2.Element = (function() { this.top("debugger;"); }, compile_action_log : function(value) { - this.top("console.log(" + this.format_expression(value) + "});"); + this.top("console.log(" + this.format_expression(value) + ");"); } }); return Element; diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index d7d8d732762..65aef0a629d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1197,7 +1197,7 @@ color: white; padding: 2px 4px; margin: 1px 6px 0 0; - border: 1px solid lightGray; + border: 1px solid lightgrey; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-border-radius: 4px; -webkit-border-radius: 4px; @@ -1222,7 +1222,7 @@ transform: scale(1.1); } .openerp .oe_secondary_submenu .oe_active { - border-top: 1px solid lightGray; + border-top: 1px solid lightgrey; border-bottom: 1px solid #dedede; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2); -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 -1px 3px rgba(40, 40, 40, 0.2); @@ -1404,60 +1404,6 @@ .openerp .oe_view_manager table.oe_view_manager_header .oe_view_manager_buttons { white-space: nowrap; } -.openerp .oe_view_manager .oe_view_manager_pager { - line-height: 26px; -} -.openerp .oe_view_manager .oe_view_manager_pager .oe_list_pager_single_page .oe_pager_group { - display: none; -} -.openerp .oe_view_manager .oe_pager_value { - float: left; - margin-right: 8px; -} -.openerp .oe_view_manager ul.oe_pager_group { - padding: 0; - margin: 0; -} -.openerp .oe_view_manager .oe_pager_group { - float: left; - height: 24px; - line-height: 24px; - display: inline-block; - border: 1px solid #ababab; - cursor: pointer; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; -} -.openerp .oe_view_manager .oe_pager_group li { - height: 24px; - line-height: 24px; - padding: 0; - margin: 0; - list-style-type: none; - float: left; - border-right: 1px solid #ababab; -} -.openerp .oe_view_manager .oe_pager_group li:last-child { - border: none; -} -.openerp .oe_view_manager .oe_pager_group a { - color: #4c4c4c; - padding: 0 8px; -} -.openerp .oe_view_manager .oe_pager_group a:hover { - text-decoration: none; -} -.openerp .oe_view_manager .oe_pager_group .active { - background: #999999; - -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; - -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; -} -.openerp .oe_view_manager .oe_pager_group .active a { - color: white; - text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); -} .openerp .oe_view_manager .oe_view_manager_switch { padding: 0; margin: 0 0 0 8px; @@ -1506,6 +1452,60 @@ .openerp .oe_view_manager .oe_view_manager_switch .oe_vm_switch_diagram:after { content: "f"; } +.openerp .oe_list_pager { + line-height: 26px; +} +.openerp .oe_list_pager .oe_pager_value { + float: left; + margin-right: 8px; +} +.openerp .oe_list_pager ul.oe_pager_group { + padding: 0; + margin: 0; +} +.openerp .oe_list_pager .oe_pager_group { + float: left; + height: 24px; + line-height: 24px; + display: inline-block; + border: 1px solid #ababab; + cursor: pointer; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} +.openerp .oe_list_pager .oe_pager_group li { + height: 24px; + line-height: 24px; + padding: 0; + margin: 0; + list-style-type: none; + float: left; + border-right: 1px solid #ababab; +} +.openerp .oe_list_pager .oe_pager_group li:last-child { + border: none; +} +.openerp .oe_list_pager .oe_pager_group a { + color: #4c4c4c; + padding: 0 8px; +} +.openerp .oe_list_pager .oe_pager_group a:hover { + text-decoration: none; +} +.openerp .oe_list_pager .oe_pager_group .active { + background: #999999; + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) inset; +} +.openerp .oe_list_pager .oe_pager_group .active a { + color: white; + text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); +} +.openerp .oe_list_pager.oe_list_pager_single_page .oe_pager_group { + display: none; +} .openerp .oe_view_manager_current { height: 100%; } @@ -1537,6 +1537,9 @@ .openerp .oe_popup_form > .oe_formview > .oe_form_pager { display: none !important; } +.openerp .oe_popup_list_pager { + float: right; +} .openerp .oe_searchview { cursor: text; position: relative; @@ -1859,6 +1862,7 @@ padding: 0; } .openerp .oe_searchview .oe_searchview_drawer .oe_searchview_advanced li { + cursor: pointer; position: relative; list-style: none; margin: 0; @@ -2147,7 +2151,7 @@ } .openerp .oe_form .oe_form_label_help[for] span, .openerp .oe_form .oe_form_label[for] span { font-size: 80%; - color: darkGreen; + color: darkgreen; vertical-align: top; position: relative; top: -4px; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c349d3c0eff..7710cadb0a7 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1136,47 +1136,6 @@ $sheet-padding: 16px .oe_view_manager_buttons white-space: nowrap // }}} - // ViewManager.pager {{{ - .oe_view_manager_pager - line-height: 26px - .oe_list_pager_single_page .oe_pager_group - display: none - .oe_pager_value - float: left - margin-right: 8px - ul.oe_pager_group - padding: 0 - margin: 0 - .oe_pager_group - float: left - height: 24px - line-height: 24px - display: inline-block - border: 1px solid #ababab - cursor: pointer - @include radius(5px) - li - height: 24px - line-height: 24px - padding: 0 - margin: 0 - list-style-type: none - float: left - border-right: 1px solid #ababab - &:last-child - border: none - a - color: #4c4c4c - padding: 0 8px - &:hover - text-decoration: none - .active - background: #999 - @include box-shadow(0 1px 4px rgba(0,0,0,0.3) inset) - a - color: #fff - text-shadow: 0 1px 2px rgba(0,0,0,0.4) - // }}} // ViewManager.switches {{{ .oe_view_manager_switch padding: 0 @@ -1217,6 +1176,47 @@ $sheet-padding: 16px .oe_vm_switch_diagram:after content: "f" // }}} + // List pager {{{ + .oe_list_pager + line-height: 26px + .oe_pager_value + float: left + margin-right: 8px + ul.oe_pager_group + padding: 0 + margin: 0 + .oe_pager_group + float: left + height: 24px + line-height: 24px + display: inline-block + border: 1px solid #ababab + cursor: pointer + @include radius(5px) + li + height: 24px + line-height: 24px + padding: 0 + margin: 0 + list-style-type: none + float: left + border-right: 1px solid #ababab + &:last-child + border: none + a + color: #4c4c4c + padding: 0 8px + &:hover + text-decoration: none + .active + background: #999 + @include box-shadow(0 1px 4px rgba(0,0,0,0.3) inset) + a + color: #fff + text-shadow: 0 1px 2px rgba(0,0,0,0.4) + .oe_list_pager.oe_list_pager_single_page .oe_pager_group + display: none + // }}} // ViewManager application {{{ .oe_view_manager_current height: 100% @@ -1237,9 +1237,11 @@ $sheet-padding: 16px > .oe_view_manager_header display: none // }}} - // Viewmanager popup {{{ + // FormPopup {{{ .oe_popup_form > .oe_formview > .oe_form_pager display: none !important + .oe_popup_list_pager + float: right // }}} // SearchView {{{ .oe_searchview @@ -1486,6 +1488,7 @@ $sheet-padding: 16px list-style: none padding: 0 li + cursor: pointer position: relative list-style: none margin: 0 diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index cb19ea61e58..5255392f316 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -52,8 +52,27 @@ instance.web.dialog = function(element) { return result; }; +/** + A useful class to handle dialogs. + + Attributes: + - $buttons: A jQuery element targeting a dom part where buttons can be added. It always exists + during the lifecycle of the dialog. +*/ instance.web.Dialog = instance.web.Widget.extend({ dialog_title: "", + /** + Constructor. + + @param {Widget} parent + @param {dictionary} options A dictionary that will be forwarded to jQueryUI Dialog. Additionaly, that + dictionary can contain the following keys: + - buttons: The buttons key is not propagated to jQueryUI Dialog. It must be a dictionary (key = button label, + value = click handler) or a list of dictionaries (each element in the dictionary is send to the corresponding + method of a jQuery element targeting the