diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 0b20e89f583..27cde36fa34 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -103,6 +103,7 @@ class WebClient(openerpweb.Controller): addons = self.server_wide_modules(req) else: addons = addons.split(',') + r = [] for addon in addons: manifest = openerpweb.addons_manifest.get(addon, None) if not manifest: @@ -112,7 +113,8 @@ class WebClient(openerpweb.Controller): globlist = manifest.get(key, []) for pattern in globlist: for path in glob.glob(os.path.normpath(os.path.join(addons_path, addon, pattern))): - yield path, path[len(addons_path):] + r.append( (path, path[len(addons_path):])) + return r def manifest_list(self, req, mods, extension): if not req.debug: diff --git a/addons/web/po/de.po b/addons/web/po/de.po index 4bbb190ed70..06901823f40 100644 --- a/addons/web/po/de.po +++ b/addons/web/po/de.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-05 11:50+0100\n" -"PO-Revision-Date: 2011-12-03 10:42+0000\n" +"PO-Revision-Date: 2011-12-08 09:00+0000\n" "Last-Translator: Ferdinand @ Camptocamp \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-12-06 05:58+0000\n" -"X-Generator: Launchpad (build 14435)\n" +"X-Launchpad-Export-Date: 2011-12-09 05:17+0000\n" +"X-Generator: Launchpad (build 14450)\n" #: addons/web/static/src/js/data_import.js:73 #: addons/web/static/src/js/view_form.js:2799 @@ -25,15 +25,15 @@ msgstr "Schließen" #: addons/web/static/src/js/data_import.js:74 msgid "Import File" -msgstr "" +msgstr "Datei importieren" #: addons/web/static/src/js/data_import.js:109 msgid "External ID" -msgstr "" +msgstr "Externe ID" #: addons/web/static/src/js/search.js:231 msgid "Filter Entry" -msgstr "" +msgstr "Eintrag filtern" #: addons/web/static/src/js/search.js:233 #: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0 @@ -43,40 +43,40 @@ msgstr "Abbrechen" #: addons/web/static/src/js/search.js:236 #: addons/web/static/src/js/search.js:277 msgid "OK" -msgstr "" +msgstr "OK" #: addons/web/static/src/js/search.js:272 addons/web/static/src/xml/base.xml:0 msgid "Add to Dashboard" -msgstr "" +msgstr "Zur Anzeigetafel hinzufügen" #: addons/web/static/src/js/search.js:401 msgid "Invalid Search" -msgstr "" +msgstr "Ungültige Suche" #: addons/web/static/src/js/search.js:401 msgid "triggered from search view" -msgstr "" +msgstr "von der Suchansicht ausgelöst" #: addons/web/static/src/js/search.js:483 #, python-format msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" -msgstr "" +msgstr "Ungültiger Wert für Feld %(fieldname)s: [%(value)s] is %(message)s" #: addons/web/static/src/js/search.js:804 msgid "not a valid integer" -msgstr "" +msgstr "ungültiger Trigger" #: addons/web/static/src/js/search.js:818 msgid "not a valid number" -msgstr "" +msgstr "ungültige Nummer" #: addons/web/static/src/js/search.js:1234 msgid "contains" -msgstr "" +msgstr "enthält" #: addons/web/static/src/js/search.js:1235 msgid "doesn't contain" -msgstr "" +msgstr "enthält nicht" #: addons/web/static/src/js/search.js:1236 #: addons/web/static/src/js/search.js:1251 @@ -84,7 +84,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1291 #: addons/web/static/src/js/search.js:1313 msgid "is equal to" -msgstr "" +msgstr "Ist gleich" #: addons/web/static/src/js/search.js:1237 #: addons/web/static/src/js/search.js:1252 @@ -92,7 +92,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1292 #: addons/web/static/src/js/search.js:1314 msgid "is not equal to" -msgstr "" +msgstr "ist ungleich" #: addons/web/static/src/js/search.js:1238 #: addons/web/static/src/js/search.js:1253 @@ -100,7 +100,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1293 #: addons/web/static/src/js/search.js:1315 msgid "greater than" -msgstr "" +msgstr "ist größer als" #: addons/web/static/src/js/search.js:1239 #: addons/web/static/src/js/search.js:1254 @@ -108,7 +108,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1294 #: addons/web/static/src/js/search.js:1316 msgid "less than" -msgstr "" +msgstr "ist kleiner als" #: addons/web/static/src/js/search.js:1240 #: addons/web/static/src/js/search.js:1255 @@ -116,7 +116,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1295 #: addons/web/static/src/js/search.js:1317 msgid "greater or equal than" -msgstr "" +msgstr "ist größer oder gleich als" #: addons/web/static/src/js/search.js:1241 #: addons/web/static/src/js/search.js:1256 @@ -124,36 +124,36 @@ msgstr "" #: addons/web/static/src/js/search.js:1296 #: addons/web/static/src/js/search.js:1318 msgid "less or equal than" -msgstr "" +msgstr "ist kleiner oder gleich als" #: addons/web/static/src/js/search.js:1307 #: addons/web/static/src/js/search.js:1332 msgid "is" -msgstr "" +msgstr "ist" #: addons/web/static/src/js/search.js:1333 msgid "is not" -msgstr "" +msgstr "ist nicht" #: addons/web/static/src/js/search.js:1346 msgid "is true" -msgstr "" +msgstr "ist Wahr" #: addons/web/static/src/js/search.js:1347 msgid "is false" -msgstr "" +msgstr "ist falsch" #: addons/web/static/src/js/view_editor.js:182 msgid "Do you really want to remove this view?" -msgstr "" +msgstr "Möchten Sie diese Sicht wirklich entfernen" #: addons/web/static/src/js/view_editor.js:454 msgid "Do you really want to remove this node?" -msgstr "" +msgstr "Möchten Sie diesen Knoten wirklich entfernen?" #: addons/web/static/src/js/view_form.js:433 msgid "Do you really want to delete this record?" -msgstr "" +msgstr "Möchten Sie diesen Datensatz wirklich löschen?" #: addons/web/static/src/js/view_form.js:448 msgid "" @@ -163,7 +163,7 @@ msgstr "" #: addons/web/static/src/js/view_form.js:656 msgid "Attachments" -msgstr "" +msgstr "Anhänge" #: addons/web/static/src/js/view_form.js:1880 msgid "   Search More..." @@ -185,52 +185,52 @@ msgstr "Erzeugen" #: addons/web/static/src/js/view_list.js:263 msgid "Unlimited" -msgstr "" +msgstr "Unbegrenzt" #: addons/web/static/src/js/view_list.js:483 msgid "Do you really want to remove these records?" -msgstr "" +msgstr "Möchten Sie diese Datensätze wirklich löschen" #: addons/web/static/src/js/view_list.js:1159 msgid "Undefined" -msgstr "" +msgstr "Undefiniert" #: addons/web/static/src/js/views.js:482 msgid "Search: " -msgstr "" +msgstr "Suche: " #: addons/web/static/src/js/views.js:581 msgid "Customize" -msgstr "" +msgstr "Anpassen" #: addons/web/static/src/js/views.js:584 msgid "Manage Views" -msgstr "" +msgstr "Ansichten verwalten" #: addons/web/static/src/js/views.js:586 addons/web/static/src/js/views.js:590 #: addons/web/static/src/js/views.js:595 msgid "Manage views of the current object" -msgstr "" +msgstr "Ansichten des aktuelllen Objekts verwalten" #: addons/web/static/src/js/views.js:588 msgid "Edit Workflow" -msgstr "" +msgstr "Workflow bearbeiten" #: addons/web/static/src/js/views.js:593 msgid "Customize Object" -msgstr "" +msgstr "Objekt anpassen" #: addons/web/static/src/js/views.js:597 msgid "Translate" -msgstr "" +msgstr "Übersetzen" #: addons/web/static/src/js/views.js:599 msgid "Technical translation" -msgstr "" +msgstr "Technische Übersetzung" #: addons/web/static/src/js/views.js:604 msgid "Other Options" -msgstr "" +msgstr "Weitere Optionen" #: addons/web/static/src/js/views.js:607 addons/web/static/src/xml/base.xml:0 msgid "Import" @@ -242,19 +242,19 @@ msgstr "Export" #: addons/web/static/src/js/views.js:613 msgid "View Log" -msgstr "" +msgstr "Protokoll anzeigen" #: addons/web/static/src/js/views.js:622 msgid "Reports" -msgstr "" +msgstr "Berichte" #: addons/web/static/src/js/views.js:622 msgid "Actions" -msgstr "" +msgstr "Aktionen" #: addons/web/static/src/js/views.js:622 msgid "Links" -msgstr "" +msgstr "Links" #: addons/web/static/src/js/views.js:702 msgid "You must choose at least one record." @@ -278,11 +278,11 @@ msgstr "x" #: addons/web/static/src/xml/base.xml:0 msgid "#{title}" -msgstr "" +msgstr "#{title}" #: addons/web/static/src/xml/base.xml:0 msgid "#{text}" -msgstr "" +msgstr "#{text}" #: addons/web/static/src/xml/base.xml:0 msgid "Powered by" @@ -493,7 +493,7 @@ msgstr "Ansicht#" #: addons/web/static/src/xml/base.xml:0 msgid "More…" -msgstr "" +msgstr "Mehr ..." #: addons/web/static/src/xml/base.xml:0 msgid "Field" @@ -525,7 +525,7 @@ msgstr "Ende" #: addons/web/static/src/xml/base.xml:0 msgid "Edit" -msgstr "" +msgstr "Bearbeiten" #: addons/web/static/src/xml/base.xml:0 msgid "Duplicate" @@ -561,11 +561,11 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "\"" -msgstr "" +msgstr "\"" #: addons/web/static/src/xml/base.xml:0 msgid "Modifiers:" -msgstr "" +msgstr "Modifikatoren:" #: addons/web/static/src/xml/base.xml:0 msgid "?" @@ -577,31 +577,31 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "Field:" -msgstr "" +msgstr "Feld:" #: addons/web/static/src/xml/base.xml:0 msgid "Object:" -msgstr "" +msgstr "Objekt:" #: addons/web/static/src/xml/base.xml:0 msgid "Type:" -msgstr "" +msgstr "Typ:" #: addons/web/static/src/xml/base.xml:0 msgid "Widget:" -msgstr "" +msgstr "Bedienelement:" #: addons/web/static/src/xml/base.xml:0 msgid "Size:" -msgstr "" +msgstr "Größe:" #: addons/web/static/src/xml/base.xml:0 msgid "Context:" -msgstr "" +msgstr "Kontext:" #: addons/web/static/src/xml/base.xml:0 msgid "Domain:" -msgstr "" +msgstr "Domäne:" #: addons/web/static/src/xml/base.xml:0 msgid "On change:" @@ -609,23 +609,23 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "Relation:" -msgstr "" +msgstr "Relation:" #: addons/web/static/src/xml/base.xml:0 msgid "Selection:" -msgstr "" +msgstr "Auswahl:" #: addons/web/static/src/xml/base.xml:0 msgid "[" -msgstr "" +msgstr "[" #: addons/web/static/src/xml/base.xml:0 msgid "]" -msgstr "" +msgstr "]" #: addons/web/static/src/xml/base.xml:0 msgid "-" -msgstr "" +msgstr "-" #: addons/web/static/src/xml/base.xml:0 msgid "#" @@ -665,7 +665,7 @@ msgstr "Leeren" #: addons/web/static/src/xml/base.xml:0 msgid "Button" -msgstr "" +msgstr "Schaltfläche" #: addons/web/static/src/xml/base.xml:0 msgid "(no string)" @@ -673,19 +673,19 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "Special:" -msgstr "" +msgstr "Spezial:" #: addons/web/static/src/xml/base.xml:0 msgid "Button Type:" -msgstr "" +msgstr "Schaltfläche Typ:" #: addons/web/static/src/xml/base.xml:0 msgid "Method:" -msgstr "" +msgstr "Methode:" #: addons/web/static/src/xml/base.xml:0 msgid "Action ID:" -msgstr "" +msgstr "Aktion ID:" #: addons/web/static/src/xml/base.xml:0 msgid "Advanced Filter" @@ -709,11 +709,11 @@ msgstr "(Jeder existierende Filter mit dem selben Namen wird ersetzt)" #: addons/web/static/src/xml/base.xml:0 msgid "Select Dashboard to add this filter to:" -msgstr "" +msgstr "Anzeigetafel wählen, zu der der Filter hinzugefügt werden soll" #: addons/web/static/src/xml/base.xml:0 msgid "Title of new Dashboard item:" -msgstr "" +msgstr "Titel des neuen Elements einer Anzeigetafel" #: addons/web/static/src/xml/base.xml:0 msgid "Any of the following conditions must match" diff --git a/addons/web/po/hr.po b/addons/web/po/hr.po index 613039fa044..2d7c760b69a 100644 --- a/addons/web/po/hr.po +++ b/addons/web/po/hr.po @@ -8,14 +8,14 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-05 11:50+0100\n" -"PO-Revision-Date: 2011-11-28 14:05+0000\n" +"PO-Revision-Date: 2011-12-08 16:49+0000\n" "Last-Translator: Goran Kliska \n" "Language-Team: Croatian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-12-06 05:58+0000\n" -"X-Generator: Launchpad (build 14435)\n" +"X-Launchpad-Export-Date: 2011-12-09 05:17+0000\n" +"X-Generator: Launchpad (build 14450)\n" #: addons/web/static/src/js/data_import.js:73 #: addons/web/static/src/js/view_form.js:2799 @@ -25,15 +25,15 @@ msgstr "Zatvori" #: addons/web/static/src/js/data_import.js:74 msgid "Import File" -msgstr "" +msgstr "Uvezi datoteku" #: addons/web/static/src/js/data_import.js:109 msgid "External ID" -msgstr "" +msgstr "External ID" #: addons/web/static/src/js/search.js:231 msgid "Filter Entry" -msgstr "" +msgstr "Upis filtera" #: addons/web/static/src/js/search.js:233 #: addons/web/static/src/js/search.js:274 addons/web/static/src/xml/base.xml:0 @@ -43,11 +43,11 @@ msgstr "Odustani" #: addons/web/static/src/js/search.js:236 #: addons/web/static/src/js/search.js:277 msgid "OK" -msgstr "" +msgstr "U redu" #: addons/web/static/src/js/search.js:272 addons/web/static/src/xml/base.xml:0 msgid "Add to Dashboard" -msgstr "" +msgstr "Dodaj na nadzornu ploču" #: addons/web/static/src/js/search.js:401 msgid "Invalid Search" @@ -61,22 +61,23 @@ msgstr "" #, python-format msgid "Incorrect value for field %(fieldname)s: [%(value)s] is %(message)s" msgstr "" +"neispravna vrijednost za polje %(fieldname)s: [%(value)s] is %(message)s" #: addons/web/static/src/js/search.js:804 msgid "not a valid integer" -msgstr "" +msgstr "nije cijeli broj" #: addons/web/static/src/js/search.js:818 msgid "not a valid number" -msgstr "" +msgstr "nije ispravan broj" #: addons/web/static/src/js/search.js:1234 msgid "contains" -msgstr "" +msgstr "sadrži" #: addons/web/static/src/js/search.js:1235 msgid "doesn't contain" -msgstr "" +msgstr "ne sadrži" #: addons/web/static/src/js/search.js:1236 #: addons/web/static/src/js/search.js:1251 @@ -84,7 +85,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1291 #: addons/web/static/src/js/search.js:1313 msgid "is equal to" -msgstr "" +msgstr "je jednako" #: addons/web/static/src/js/search.js:1237 #: addons/web/static/src/js/search.js:1252 @@ -92,7 +93,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1292 #: addons/web/static/src/js/search.js:1314 msgid "is not equal to" -msgstr "" +msgstr "nije jednako" #: addons/web/static/src/js/search.js:1238 #: addons/web/static/src/js/search.js:1253 @@ -100,7 +101,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1293 #: addons/web/static/src/js/search.js:1315 msgid "greater than" -msgstr "" +msgstr "veće od" #: addons/web/static/src/js/search.js:1239 #: addons/web/static/src/js/search.js:1254 @@ -108,7 +109,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1294 #: addons/web/static/src/js/search.js:1316 msgid "less than" -msgstr "" +msgstr "manje od" #: addons/web/static/src/js/search.js:1240 #: addons/web/static/src/js/search.js:1255 @@ -116,7 +117,7 @@ msgstr "" #: addons/web/static/src/js/search.js:1295 #: addons/web/static/src/js/search.js:1317 msgid "greater or equal than" -msgstr "" +msgstr "veće ili jednako" #: addons/web/static/src/js/search.js:1241 #: addons/web/static/src/js/search.js:1256 @@ -124,36 +125,36 @@ msgstr "" #: addons/web/static/src/js/search.js:1296 #: addons/web/static/src/js/search.js:1318 msgid "less or equal than" -msgstr "" +msgstr "manje ili jednako" #: addons/web/static/src/js/search.js:1307 #: addons/web/static/src/js/search.js:1332 msgid "is" -msgstr "" +msgstr "je" #: addons/web/static/src/js/search.js:1333 msgid "is not" -msgstr "" +msgstr "nije" #: addons/web/static/src/js/search.js:1346 msgid "is true" -msgstr "" +msgstr "je istina" #: addons/web/static/src/js/search.js:1347 msgid "is false" -msgstr "" +msgstr "je laž" #: addons/web/static/src/js/view_editor.js:182 msgid "Do you really want to remove this view?" -msgstr "" +msgstr "Želite ukloniti ovaj pogled?" #: addons/web/static/src/js/view_editor.js:454 msgid "Do you really want to remove this node?" -msgstr "" +msgstr "Da li zaista želite obrisati ovaj čvor?" #: addons/web/static/src/js/view_form.js:433 msgid "Do you really want to delete this record?" -msgstr "" +msgstr "Da li zaista želite obrisati ovaj zapis?" #: addons/web/static/src/js/view_form.js:448 msgid "" @@ -162,7 +163,7 @@ msgstr "Upozorenje, zapis je promjenjen. Promjene se neće zapisati." #: addons/web/static/src/js/view_form.js:656 msgid "Attachments" -msgstr "" +msgstr "Privici" #: addons/web/static/src/js/view_form.js:1880 msgid "   Search More..." @@ -184,52 +185,52 @@ msgstr "Kreiraj" #: addons/web/static/src/js/view_list.js:263 msgid "Unlimited" -msgstr "" +msgstr "Neograničen" #: addons/web/static/src/js/view_list.js:483 msgid "Do you really want to remove these records?" -msgstr "" +msgstr "Zaista želite obrisati ove zapise?" #: addons/web/static/src/js/view_list.js:1159 msgid "Undefined" -msgstr "" +msgstr "Nedefiniran" #: addons/web/static/src/js/views.js:482 msgid "Search: " -msgstr "" +msgstr "Traži: " #: addons/web/static/src/js/views.js:581 msgid "Customize" -msgstr "" +msgstr "Prilagodi" #: addons/web/static/src/js/views.js:584 msgid "Manage Views" -msgstr "" +msgstr "Upravljanje pogledima" #: addons/web/static/src/js/views.js:586 addons/web/static/src/js/views.js:590 #: addons/web/static/src/js/views.js:595 msgid "Manage views of the current object" -msgstr "" +msgstr "Pogledi trenutnog objekta" #: addons/web/static/src/js/views.js:588 msgid "Edit Workflow" -msgstr "" +msgstr "Uredi tijek rada" #: addons/web/static/src/js/views.js:593 msgid "Customize Object" -msgstr "" +msgstr "Prilagodi objekt" #: addons/web/static/src/js/views.js:597 msgid "Translate" -msgstr "" +msgstr "Prevedi" #: addons/web/static/src/js/views.js:599 msgid "Technical translation" -msgstr "" +msgstr "Tehnički prijevod" #: addons/web/static/src/js/views.js:604 msgid "Other Options" -msgstr "" +msgstr "Ostale postavke" #: addons/web/static/src/js/views.js:607 addons/web/static/src/xml/base.xml:0 msgid "Import" @@ -241,19 +242,19 @@ msgstr "Izvoz" #: addons/web/static/src/js/views.js:613 msgid "View Log" -msgstr "" +msgstr "Prikaži zapisnik" #: addons/web/static/src/js/views.js:622 msgid "Reports" -msgstr "" +msgstr "Izvještaji" #: addons/web/static/src/js/views.js:622 msgid "Actions" -msgstr "" +msgstr "Akcije" #: addons/web/static/src/js/views.js:622 msgid "Links" -msgstr "" +msgstr "Poveznice" #: addons/web/static/src/js/views.js:702 msgid "You must choose at least one record." @@ -277,23 +278,23 @@ msgstr "x" #: addons/web/static/src/xml/base.xml:0 msgid "#{title}" -msgstr "" +msgstr "#{title}" #: addons/web/static/src/xml/base.xml:0 msgid "#{text}" -msgstr "" +msgstr "#{text}" #: addons/web/static/src/xml/base.xml:0 msgid "Powered by" -msgstr "" +msgstr "Powered by" #: addons/web/static/src/xml/base.xml:0 msgid "openerp.com" -msgstr "" +msgstr "openerp.com" #: addons/web/static/src/xml/base.xml:0 msgid "." -msgstr "" +msgstr "." #: addons/web/static/src/xml/base.xml:0 msgid "Loading..." @@ -444,11 +445,11 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "(" -msgstr "" +msgstr "(" #: addons/web/static/src/xml/base.xml:0 msgid ")" -msgstr "" +msgstr ")" #: addons/web/static/src/xml/base.xml:0 msgid "LOGOUT" @@ -456,19 +457,19 @@ msgstr "ODJAVA" #: addons/web/static/src/xml/base.xml:0 msgid "«" -msgstr "" +msgstr "«" #: addons/web/static/src/xml/base.xml:0 msgid "»" -msgstr "" +msgstr "»" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_menu_item" -msgstr "" +msgstr "oe_secondary_menu_item" #: addons/web/static/src/xml/base.xml:0 msgid "oe_secondary_submenu_item" -msgstr "" +msgstr "oe_secondary_submenu_item" #: addons/web/static/src/xml/base.xml:0 msgid "Hide this tip" @@ -484,7 +485,7 @@ msgstr "Pogled#" #: addons/web/static/src/xml/base.xml:0 msgid "More…" -msgstr "" +msgstr "Više..." #: addons/web/static/src/xml/base.xml:0 msgid "Field" @@ -516,7 +517,7 @@ msgstr "Posljednji" #: addons/web/static/src/xml/base.xml:0 msgid "Edit" -msgstr "" +msgstr "Uredi" #: addons/web/static/src/xml/base.xml:0 msgid "Duplicate" @@ -552,7 +553,7 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "\"" -msgstr "" +msgstr "\"" #: addons/web/static/src/xml/base.xml:0 msgid "Modifiers:" @@ -564,51 +565,51 @@ msgstr "?" #: addons/web/static/src/xml/base.xml:0 msgid "(nolabel)" -msgstr "" +msgstr "(bezlabele)" #: addons/web/static/src/xml/base.xml:0 msgid "Field:" -msgstr "" +msgstr "Polje:" #: addons/web/static/src/xml/base.xml:0 msgid "Object:" -msgstr "" +msgstr "Objekt:" #: addons/web/static/src/xml/base.xml:0 msgid "Type:" -msgstr "" +msgstr "Tip:" #: addons/web/static/src/xml/base.xml:0 msgid "Widget:" -msgstr "" +msgstr "Widget:" #: addons/web/static/src/xml/base.xml:0 msgid "Size:" -msgstr "" +msgstr "Veličina" #: addons/web/static/src/xml/base.xml:0 msgid "Context:" -msgstr "" +msgstr "Kontekst:" #: addons/web/static/src/xml/base.xml:0 msgid "Domain:" -msgstr "" +msgstr "Domena:" #: addons/web/static/src/xml/base.xml:0 msgid "On change:" -msgstr "" +msgstr "On change:" #: addons/web/static/src/xml/base.xml:0 msgid "Relation:" -msgstr "" +msgstr "Relacija:" #: addons/web/static/src/xml/base.xml:0 msgid "Selection:" -msgstr "" +msgstr "Odabir:" #: addons/web/static/src/xml/base.xml:0 msgid "[" -msgstr "" +msgstr "[" #: addons/web/static/src/xml/base.xml:0 msgid "]" @@ -616,7 +617,7 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "-" -msgstr "" +msgstr "-" #: addons/web/static/src/xml/base.xml:0 msgid "#" @@ -656,7 +657,7 @@ msgstr "Očisti" #: addons/web/static/src/xml/base.xml:0 msgid "Button" -msgstr "" +msgstr "Gumb" #: addons/web/static/src/xml/base.xml:0 msgid "(no string)" @@ -672,11 +673,11 @@ msgstr "" #: addons/web/static/src/xml/base.xml:0 msgid "Method:" -msgstr "" +msgstr "Metoda:" #: addons/web/static/src/xml/base.xml:0 msgid "Action ID:" -msgstr "" +msgstr "Action ID:" #: addons/web/static/src/xml/base.xml:0 msgid "Advanced Filter" diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 067ea09cd38..3a163beb832 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -768,13 +768,17 @@ label.error { padding: 1px 2px; } -.openerp .oe-record-delete button{ +.openerp .oe-record-delete button, +.openerp button.oe-edit-row-save { border: none; height: 12px; width: 12px; background: url("/web/static/src/img/iconset-b-remove.png") no-repeat scroll center center transparent; cursor: pointer; } +.openerp button.oe-edit-row-save { + background-image: url('/web/static/src/img/icons/save-document.png'); +} /* Could use :not selectors if they were supported by MSIE8... */ .openerp .oe-listview tbody td { @@ -952,13 +956,19 @@ label.error { background: #f9f9f9; } /* Unedit Form */ -.openerp .field_char, .openerp .field_date, .openerp .field_float, .openerp .oe_form_field_many2one a { +.openerp .field_char, +.openerp .field_date, +.openerp .field_float, +.openerp .field_selection, +.openerp .oe_form_field_many2one a, +.openerp .oe_form_field_reference a{ vertical-align: middle; padding-top: 3px; font-size: 90%; color: #222; } -.openerp .oe_form_field_many2one a { +.openerp .oe_form_field_many2one a, +.openerp .oe_form_field_reference a { color: #9A0404; line-height: 12px; } @@ -1061,6 +1071,7 @@ label.error { .openerp .oe_forms label.oe_label, .openerp .oe_forms label.oe_label_help { margin: 4px 0 0 3px; + white-space: nowrap; } .openerp .oe_forms .searchview_group_content label.oe_label, .openerp .searchview_group_content .oe_forms label.oe_label_help { /* making a distinction between labels in search view and other labels */ margin: 3px 0 0 3px; @@ -1153,9 +1164,9 @@ label.error { .openerp .oe_input_icon { position: absolute; cursor: pointer; - right: 5px; - top: 3px; - z-index: 2; + right: 4px; + top: 5px; + z-index: 1; } .openerp .oe_datepicker_container { position: absolute; @@ -1164,7 +1175,6 @@ label.error { display: none; } .openerp .oe_datepicker_root { - position: relative; display: inline-block; } .openerp .oe_forms.oe_frame .oe_datepicker_root { @@ -1178,13 +1188,6 @@ label.error { right: 5px; top: 3px; } -.openerp img.oe_field_translate { - margin-left: -21px; - vertical-align: top; - cursor: pointer; - position: relative; - top: 4px; -} .openerp .oe_trad_field.touched { border: 1px solid green !important; } diff --git a/addons/web/static/src/img/icons/save-document.png b/addons/web/static/src/img/icons/save-document.png new file mode 100644 index 00000000000..8933ca0bed9 Binary files /dev/null and b/addons/web/static/src/img/icons/save-document.png differ diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index d08ff3c7491..dc312706427 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -837,7 +837,8 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ init: function(parent, element_id, secondary_menu_id) { this._super(parent, element_id); this.secondary_menu_id = secondary_menu_id; - this.$secondary_menu = $("#" + secondary_menu_id).hide(); + this.$secondary_menu = $("#" + secondary_menu_id); + this.$secondary_menu.hide(); this.menu = false; this.folded = false; if (window.localStorage) { @@ -911,7 +912,10 @@ openerp.web.Menu = openerp.web.Widget.extend(/** @lends openerp.web.Menu# */{ sub_menu_visible = $sub_menu.is(':visible'); this.$secondary_menu.find('.oe_secondary_menu').hide(); - $('.active', this.$element.add(this.$secondary_menu.show())).removeClass('active'); + if (this.$secondary_menu.hasClass('oe_folded')) { + this.$secondary_menu.show(); + } + $('.active', this.$element.add(this.$secondary_menu)).removeClass('active'); $main_menu.add($clicked_menu).add($sub_menu).addClass('active'); if (!(this.folded && manual)) { @@ -1076,15 +1080,7 @@ openerp.web.WebClient = openerp.web.Widget.extend(/** @lends openerp.web.WebClie // TODO: add actual loading if there is url state to unpack, test on window.location.hash // not logged in if (!this.session.uid) { return; } - var ds = new openerp.web.DataSetSearch(this, 'res.users'); - ds.read_ids([this.session.uid], ['action_id'], function (users) { - var home_action = users[0].action_id; - if (!home_action) { - self.default_home(); - return; - } - self.execute_home_action(home_action[0], ds); - }) + self.action_manager.do_action({type: 'ir.actions.client', tag: 'default_home'}); }, default_home: function () { }, diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 0e813f99166..2f89eaca5a6 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -356,8 +356,8 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# }, on_button_save: function() { var self = this; - return this.do_save().then(function() { - self.do_prev_view(); + return this.do_save().then(function(result) { + self.do_prev_view(result.created); }); }, on_button_cancel: function() { @@ -423,22 +423,22 @@ openerp.web.FormView = openerp.web.View.extend( /** @lends openerp.web.FormView# self.on_invalid(); return $.Deferred().reject(); } else { + var save_deferral; if (!self.datarecord.id) { openerp.log("FormView(", self, ") : About to create", values); - return self.dataset.create(values).pipe(function(r) { + save_deferral = self.dataset.create(values).pipe(function(r) { return self.on_created(r, undefined, prepend_on_create); - }).then(success); + }, null); } else if (_.isEmpty(values)) { openerp.log("FormView(", self, ") : Nothing to save"); - if (success) { - success(); - } + save_deferral = $.Deferred().resolve({}).promise(); } else { openerp.log("FormView(", self, ") : About to save", values); - return self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) { + save_deferral = self.dataset.write(self.datarecord.id, values, {}).pipe(function(r) { return self.on_saved(r); - }).then(success); + }, null); } + return save_deferral.then(success); } } catch (e) { console.error(e); @@ -1582,7 +1582,7 @@ openerp.web.form.FieldSelection = openerp.web.form.Field.extend({ .change(function () { ischanging = true; }) .click(function () { ischanging = false; }) .keyup(function (e) { - if (e.which !== 13 || !ischanging) { return; } + if (!_([13, 38, 40]).contains(e.which) || !ischanging) { return; } e.stopPropagation(); ischanging = false; }); @@ -1790,13 +1790,16 @@ openerp.web.form.FieldMany2One = openerp.web.form.Field.extend({ minLength: 0, delay: 0 }); - // used to correct a bug when selecting an element by pushing 'enter' in an editable list + // Don't propagate KEY_UP and KEY_DOWN event to parent (for editable + // list), don't propagate KEY_RETURN either when the autocomplete + // control is currently open this.$input.keyup(function(e) { - if (e.which === 13) { - if (isSelecting) - e.stopPropagation(); + if (e.which === 38 || e.which === 40) { + e.stopPropagation(); + } else if (isSelecting && e.which === 13) { + e.stopPropagation(); + isSelecting = false; } - isSelecting = false; }); }, // autocomplete component content handling @@ -2449,7 +2452,9 @@ openerp.web.form.Many2ManyListView = openerp.web.ListView.extend(/** @lends open do_activate_record: function(index, id) { var self = this; var pop = new openerp.web.form.FormOpenPopup(this); - pop.show_element(this.dataset.model, id, this.m2m_field.build_context(), {}); + pop.show_element(this.dataset.model, id, this.m2m_field.build_context(), { + readonly: this.widget_parent.is_readonly() + }); pop.on_write_completed.add_last(function() { self.reload_content(); }); @@ -2782,6 +2787,7 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ name: 'selection', widget: 'selection' }}); + this.reference_ready = true; this.selection.on_value_changed.add_last(this.on_selection_changed); this.m2o = new openerp.web.form.FieldMany2One(this, { attrs: { name: 'm2o', @@ -2791,10 +2797,12 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ on_nop: function() { }, on_selection_changed: function() { - var sel = this.selection.get_value(); - this.m2o.field.relation = sel; - this.m2o.set_value(null); - this.m2o.$element.toggle(sel !== false); + if (this.reference_ready) { + var sel = this.selection.get_value(); + this.m2o.field.relation = sel; + this.m2o.set_value(null); + this.m2o.$element.toggle(sel !== false); + } }, start: function() { this._super(); @@ -2809,11 +2817,18 @@ openerp.web.form.FieldReference = openerp.web.form.Field.extend({ }, set_value: function(value) { this._super(value); + this.reference_ready = false; + var vals = [], sel_val, m2o_val; if (typeof(value) === 'string') { - var vals = value.split(','); - this.selection.set_value(vals[0]); - this.m2o.set_value(parseInt(vals[1], 10)); + vals = value.split(','); } + sel_val = vals[0] || false; + m2o_val = vals[1] ? parseInt(vals[1], 10) : false; + this.selection.set_value(sel_val); + this.m2o.field.relation = sel_val; + this.m2o.set_value(m2o_val); + this.m2o.$element.toggle(sel_val !== false); + this.reference_ready = true; }, get_value: function() { var model = this.selection.get_value(), diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 6e62955f0b1..79900a9ec43 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -391,7 +391,7 @@ openerp.web.ListView = openerp.web.View.extend( /** @lends openerp.web.ListView# * @param {String} [view="page"] the view type to switch to */ select_record:function (index, view) { - view = view || 'page'; + view = view || index == null ? 'form' : 'page'; this.dataset.index = index; _.delay(_.bind(function () { this.do_switch_view(view); @@ -1279,6 +1279,7 @@ openerp.web.ListView.Groups = openerp.web.Class.extend( /** @lends openerp.web.L list.$current.sortable({ axis: 'y', items: '> tr[data-id]', + containment: 'parent', stop: function (event, ui) { var to_move = list.records.get(ui.item.data('id')), target_id = ui.item.prev().data('id'), diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index f6b7f85dee1..805ce0de1af 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -3,8 +3,11 @@ * @namespace */ openerp.web.list_editable = function (openerp) { + // https://developer.mozilla.org/en/DOM/KeyboardEvent#Virtual_key_codes var KEY_RETURN = 13, - KEY_ESCAPE = 27; + KEY_ESCAPE = 27, + KEY_UP = 38, + KEY_DOWN = 40; var QWeb = openerp.web.qweb; // editability status of list rows @@ -166,6 +169,68 @@ openerp.web.list_editable = function (openerp) { view.arch.attrs.col = 2 * view.arch.children.length; return view; }, + on_row_keyup: function (e) { + var self = this; + switch (e.which) { + case KEY_RETURN: + this.save_row().then(function (result) { + if (result.created) { + self.new_record(); + return; + } + + var next_record_id, + next_record = self.records.at( + self.records.indexOf(result.edited_record) + 1); + if (next_record) { + next_record_id = next_record.get('id'); + self.dataset.index = _(self.dataset.ids) + .indexOf(next_record_id); + } else { + self.dataset.index = 0; + next_record_id = self.records.at(0).get('id'); + } + self.edit_record(next_record_id); + }); + break; + case KEY_DOWN: + this.save_row().then(function (result) { + var next_record_id, + next_record = self.records.at( + self.records.indexOf(result.edited_record) + 1); + if (next_record) { + next_record_id = next_record.get('id'); + self.dataset.index = _(self.dataset.ids) + .indexOf(next_record_id); + } else { + self.dataset.index = 0; + next_record_id = self.records.at(0).get('id'); + } + self.edit_record(next_record_id); + }); + break; + case KEY_UP: + this.save_row().then(function (result) { + var previous_record_id, + previous_record = self.records.at( + self.records.indexOf(result.edited_record) - 1); + if (previous_record) { + previous_record_id = previous_record.get('id'); + self.dataset.index = _(self.dataset.ids) + .indexOf(previous_record_id); + } else { + var last = self.records.length - 1; + self.dataset.index = last; + previous_record_id = self.records.at(last).get('id'); + } + self.edit_record(previous_record_id); + }); + break; + case KEY_ESCAPE: + this.cancel_edition(); + break; + } + }, render_row_as_form: function (row) { var self = this; this.cancel_pending_edition().then(function () { @@ -179,24 +244,10 @@ openerp.web.list_editable = function (openerp) { .delegate('button.oe-edit-row-save', 'click', function () { self.save_row(); }) - .delegate('button.oe-edit-row-cancel', 'click', function () { - self.cancel_edition(); - }) .delegate('button', 'keyup', function (e) { e.stopImmediatePropagation(); }) - .keyup(function (e) { - switch (e.which) { - case KEY_RETURN: - self.save_row(true); - break; - case KEY_ESCAPE: - self.cancel_edition(); - break; - default: - return; - } - }); + .keyup($.proxy(self, 'on_row_keyup')); if (row) { $new_row.replaceAll(row); } else if (self.options.editable) { @@ -231,20 +282,18 @@ openerp.web.list_editable = function (openerp) { .addClass('oe-field-cell') .removeAttr('width') .end() - .find('td:first').removeClass('oe-field-cell').end() .find('td:last').removeClass('oe-field-cell').end(); + if (self.options.selectable) { + $new_row.prepend(''); + } // pad in case of groupby _(self.columns).each(function (column) { if (column.meta) { $new_row.prepend(''); } }); - // Add columns for the cancel and save buttons, if - // there are none in the list - if (!self.options.selectable) { - self.view.pad_columns( - 1, {except: $new_row, position: 'before'}); - } + // Add column for the save, if + // there is none in the list if (!self.options.deletable) { self.view.pad_columns( 1, {except: $new_row}); @@ -274,53 +323,43 @@ openerp.web.list_editable = function (openerp) { }); }, /** - * Saves the current row, and triggers the edition of its following - * sibling if asked. + * Saves the current row, and returns a Deferred resolving to an object + * with the following properties: * - * @param {Boolean} [edit_next=false] should the next row become editable - * @returns {$.Deferred} + * ``created`` + * Boolean flag indicating whether the record saved was being created + * (``true`` or edited (``false``) + * ``edited_record`` + * The result of saving the record (either the newly created record, + * or the post-edition record), after insertion in the Collection if + * needs be. + * + * @returns {$.Deferred<{created: Boolean, edited_record: Record}>} */ - save_row: function (edit_next) { + save_row: function () { //noinspection JSPotentiallyInvalidConstructorUsage var self = this, done = $.Deferred(); - this.edition_form.do_save(function (result) { - if (result.created && !self.edition_id) { - self.records.add({id: result.result}, - {at: self.options.editable === 'top' ? 0 : null}); - self.edition_id = result.result; - } - var edited_record = self.records.get(self.edition_id), - next_record = self.records.at( - self.records.indexOf(edited_record) + 1); + return this.edition_form + .do_save(null, this.options.editable === 'top') + .pipe(function (result) { + if (result.created && !self.edition_id) { + self.records.add({id: result.result}, + {at: self.options.editable === 'top' ? 0 : null}); + self.edition_id = result.result; + } + var edited_record = self.records.get(self.edition_id); - $.when( - self.handle_onwrite(self.edition_id), - self.cancel_pending_edition().then(function () { - $(self).trigger('saved', [self.dataset]); - if (!edit_next) { - return; - } - if (result.created) { - self.new_record(); - return; - } - var next_record_id; - if (next_record) { - next_record_id = next_record.get('id'); - self.dataset.index = _(self.dataset.ids) - .indexOf(next_record_id); - } else { - self.dataset.index = 0; - next_record_id = self.records.at(0).get('id'); - } - self.edit_record(next_record_id); - })).then(function () { - done.resolve(); - }); - }, this.options.editable === 'top').fail(function () { - done.reject(); - }); - return done.promise(); + return $.when( + self.handle_onwrite(self.edition_id), + self.cancel_pending_edition().then(function () { + $(self).trigger('saved', [self.dataset]); + })).pipe(function () { + return { + created: result.created || false, + edited_record: edited_record + }; + }, null); + }, null); }, /** * If the current list is being edited, ensures it's saved diff --git a/addons/web/static/src/js/view_page.js b/addons/web/static/src/js/view_page.js index ee7ce2537ad..2ca07152a56 100644 --- a/addons/web/static/src/js/view_page.js +++ b/addons/web/static/src/js/view_page.js @@ -7,7 +7,7 @@ openerp.web.page = function (openerp) { form_template: "PageView", init: function () { this._super.apply(this, arguments); - this.registry = openerp.web.form.readonly; + this.registry = openerp.web.page.readonly; }, on_loaded: function(data) { this._super(data); @@ -55,10 +55,14 @@ openerp.web.page = function (openerp) { return def.promise(); } }); - openerp.web.form.FieldReadonly = openerp.web.form.Field.extend({ + + /** @namespace */ + openerp.web.page = {}; + + openerp.web.page.FieldReadonly = openerp.web.form.Field.extend({ }); - openerp.web.form.FieldCharReadonly = openerp.web.form.FieldReadonly.extend({ + openerp.web.page.FieldCharReadonly = openerp.web.page.FieldReadonly.extend({ template: 'FieldChar.readonly', init: function(view, node) { this._super(view, node); @@ -74,7 +78,7 @@ openerp.web.page = function (openerp) { return show_value; } }); - openerp.web.form.FieldURIReadonly = openerp.web.form.FieldCharReadonly.extend({ + openerp.web.page.FieldURIReadonly = openerp.web.page.FieldCharReadonly.extend({ template: 'FieldURI.readonly', scheme: null, set_value: function (value) { @@ -84,10 +88,10 @@ openerp.web.page = function (openerp) { .text(displayed); } }); - openerp.web.form.FieldEmailReadonly = openerp.web.form.FieldURIReadonly.extend({ + openerp.web.page.FieldEmailReadonly = openerp.web.page.FieldURIReadonly.extend({ scheme: 'mailto' }); - openerp.web.form.FieldUrlReadonly = openerp.web.form.FieldURIReadonly.extend({ + openerp.web.page.FieldUrlReadonly = openerp.web.page.FieldURIReadonly.extend({ set_value: function (value) { var s = /(\w+):(.+)/.exec(value); if (!s || !(s[1] === 'http' || s[1] === 'https')) { return; } @@ -95,12 +99,12 @@ openerp.web.page = function (openerp) { this._super(s[2]); } }); - openerp.web.form.FieldBooleanReadonly = openerp.web.form.FieldCharReadonly.extend({ + openerp.web.page.FieldBooleanReadonly = openerp.web.page.FieldCharReadonly.extend({ set_value: function (value) { this._super(value ? '\u2611' : '\u2610'); } }); - openerp.web.form.FieldSelectionReadonly = openerp.web.form.FieldReadonly.extend({ + openerp.web.page.FieldSelectionReadonly = openerp.web.page.FieldReadonly.extend({ template: 'FieldChar.readonly', init: function(view, node) { // lifted straight from r/w version @@ -123,7 +127,7 @@ openerp.web.page = function (openerp) { this.$element.find('div').text(option ? option[1] : this.values[0][1]); } }); - openerp.web.form.FieldMany2OneReadonly = openerp.web.form.FieldURIReadonly.extend({ + openerp.web.page.FieldMany2OneReadonly = openerp.web.page.FieldURIReadonly.extend({ set_value: function (value) { value = value || null; this.invalid = false; @@ -168,29 +172,47 @@ openerp.web.page = function (openerp) { } } }); - - openerp.web.form.FieldMany2ManyReadonly = openerp.web.form.FieldMany2Many.extend({ + openerp.web.page.FieldReferenceReadonly = openerp.web.page.FieldMany2OneReadonly.extend({ + set_value: function (value) { + if (!value) { + return this._super(null); + } + var reference = value.split(','); + this.field.relation = reference[0]; + var id = parseInt(reference[1], 10); + return this._super(id); + }, + get_value: function () { + if (!this.value) { + return null; + } + return _.str.sprintf('%s,%d', this.field.relation, this.value[0]); + } + }); + + openerp.web.page.FieldMany2ManyReadonly = openerp.web.form.FieldMany2Many.extend({ force_readonly: true }); - openerp.web.form.FieldOne2ManyReadonly = openerp.web.form.FieldOne2Many.extend({ + openerp.web.page.FieldOne2ManyReadonly = openerp.web.form.FieldOne2Many.extend({ force_readonly: true }); - openerp.web.form.readonly = openerp.web.form.widgets.clone({ - 'char': 'openerp.web.form.FieldCharReadonly', - 'email': 'openerp.web.form.FieldEmailReadonly', - 'url': 'openerp.web.form.FieldUrlReadonly', - 'text': 'openerp.web.form.FieldCharReadonly', - 'text_wiki' : 'openerp.web.form.FieldCharReadonly', - 'date': 'openerp.web.form.FieldCharReadonly', - 'datetime': 'openerp.web.form.FieldCharReadonly', - 'selection' : 'openerp.web.form.FieldSelectionReadonly', - 'many2one': 'openerp.web.form.FieldMany2OneReadonly', - 'many2many' : 'openerp.web.form.FieldMany2ManyReadonly', - 'one2many' : 'openerp.web.form.FieldOne2ManyReadonly', - 'one2many_list' : 'openerp.web.form.FieldOne2ManyReadonly', - 'boolean': 'openerp.web.form.FieldBooleanReadonly', - 'float': 'openerp.web.form.FieldCharReadonly', - 'integer': 'openerp.web.form.FieldCharReadonly', - 'float_time': 'openerp.web.form.FieldCharReadonly' + openerp.web.page.readonly = openerp.web.form.widgets.clone({ + 'char': 'openerp.web.page.FieldCharReadonly', + 'email': 'openerp.web.page.FieldEmailReadonly', + 'url': 'openerp.web.page.FieldUrlReadonly', + 'text': 'openerp.web.page.FieldCharReadonly', + 'text_wiki' : 'openerp.web.page.FieldCharReadonly', + 'date': 'openerp.web.page.FieldCharReadonly', + 'datetime': 'openerp.web.page.FieldCharReadonly', + 'selection' : 'openerp.web.page.FieldSelectionReadonly', + 'many2one': 'openerp.web.page.FieldMany2OneReadonly', + 'many2many' : 'openerp.web.page.FieldMany2ManyReadonly', + 'one2many' : 'openerp.web.page.FieldOne2ManyReadonly', + 'one2many_list' : 'openerp.web.page.FieldOne2ManyReadonly', + 'reference': 'openerp.web.page.FieldReferenceReadonly', + 'boolean': 'openerp.web.page.FieldBooleanReadonly', + 'float': 'openerp.web.page.FieldCharReadonly', + 'integer': 'openerp.web.page.FieldCharReadonly', + 'float_time': 'openerp.web.page.FieldCharReadonly' }); }; diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index 5d55fffd281..0d8621ddd49 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -75,6 +75,10 @@ session.web.ActionManager = session.web.Widget.extend({ } }, do_action: function(action, on_close) { + if (!action.type) { + console.error("No type for action", action); + return; + } var type = action.type.replace(/\./g,'_'); var popup = action.target === 'new'; action.flags = _.extend({ @@ -85,7 +89,7 @@ session.web.ActionManager = session.web.Widget.extend({ pager : !popup }, action.flags || {}); if (!(type in this)) { - console.log("Action manager can't handle action of type " + action.type, action); + console.error("Action manager can't handle action of type " + action.type, action); return; } return this[type](action, on_close); @@ -197,7 +201,6 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View this.views = {}; this.flags = this.flags || {}; this.registry = session.web.views; - this.views = []; this.views_history = []; }, render: function() { @@ -301,10 +304,23 @@ session.web.ViewManager = session.web.Widget.extend(/** @lends session.web.View }); return view_promise; }, - on_prev_view: function () { - this.views_history.pop(); + /** + * Returns to the view preceding the caller view in this manager's + * navigation history (the navigation history is appended to via + * on_mode_switch) + * + * @param {Boolean} [created=false] returning from a creation + * @returns {$.Deferred} switching end signal + */ + on_prev_view: function (created) { + var current_view = this.views_history.pop(); var previous_view = this.views_history[this.views_history.length - 1]; - this.on_mode_switch(previous_view, true); + // APR special case: "If creation mode from list (and only from a list), + // after saving, go to page view (don't come back in list)" + if (created && current_view === 'form' && previous_view === 'list') { + return this.on_mode_switch('page'); + } + return this.on_mode_switch(previous_view, true); }, /** * Sets up the current viewmanager's search view. @@ -393,10 +409,16 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner } this.dataset = dataset; this.flags = this.action.flags || {}; - if (action.res_model == 'board.board' && action.views.length == 1 && action.views) { - // Not elegant but allows to avoid form chrome (pager, save/new - // buttons, sidebar, ...) displaying - this.flags.display_title = this.flags.search_view = this.flags.pager = this.flags.sidebar = this.flags.action_buttons = false; + if (action.res_model == 'board.board' && action.view_mode === 'form') { + // Special case for Dashboards + _.extend(this.flags, { + views_switcher : false, + display_title : false, + search_view : false, + pager : false, + sidebar : false, + action_buttons : false + }); } // setup storage for session-wise menu hiding @@ -431,10 +453,11 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner var manager_ready = $.when(searchview_loaded, main_view_loaded); this.$element.find('.oe_get_xml_view').click(function () { - // TODO: add search view? - $('
').text(session.web.json_node_to_xml(
-                self.views[self.active_view].controller.fields_view.arch, true))
-                    .dialog({ width: '95%'});
+            var view = self.views[self.active_view].controller,
+                view_id = view.fields_view.view_id;
+            if (view_id) {
+                view.on_sidebar_edit_resource('ir.ui.view', view_id);
+            }
         });
         if (this.action.help && !this.flags.low_profile) {
             var Users = new session.web.DataSet(self, 'res.users'),
@@ -480,7 +503,7 @@ session.web.ViewManagerAction = session.web.ViewManager.extend(/** @lends oepner
             self.$element.find('.oe-view-manager-logs:first')
                 .addClass('oe-folded').removeClass('oe-has-more')
                 .find('ul').empty();
-            self.shortcut_check(self.views[view_type])
+            self.shortcut_check(self.views[view_type]);
         });
         return $.when(
                 switched
@@ -595,25 +618,29 @@ session.web.Sidebar = session.web.Widget.extend({
         });
     },
     add_default_sections: function() {
+        var self = this,
+            view = this.widget_parent,
+            view_manager = view.widget_parent,
+            action = view_manager.action;
         if (this.session.uid === 1) {
             this.add_section(_t('Customize'), 'customize');
             this.add_items('customize', [
                 {
                     label: _t("Manage Views"),
-                    callback: this.widget_parent.on_sidebar_manage_views,
+                    callback: view.on_sidebar_manage_views,
                     title: _t("Manage views of the current object")
                 }, {
                     label: _t("Edit Workflow"),
-                    callback: this.widget_parent.on_sidebar_edit_workflow,
+                    callback: view.on_sidebar_edit_workflow,
                     title: _t("Manage views of the current object"),
                     classname: 'oe_hide oe_sidebar_edit_workflow'
                 }, {
                     label: _t("Customize Object"),
-                    callback: this.widget_parent.on_sidebar_customize_object,
+                    callback: view.on_sidebar_customize_object,
                     title: _t("Manage views of the current object")
                 }, {
                     label: _t("Translate"),
-                    callback: this.widget_parent.on_sidebar_translate,
+                    callback: view.on_sidebar_translate,
                     title: _t("Technical translation")
                 }
             ]);
@@ -623,16 +650,36 @@ session.web.Sidebar = session.web.Widget.extend({
         this.add_items('other', [
             {
                 label: _t("Import"),
-                callback: this.widget_parent.on_sidebar_import
+                callback: view.on_sidebar_import
             }, {
                 label: _t("Export"),
-                callback: this.widget_parent.on_sidebar_export
+                callback: view.on_sidebar_export
             }, {
                 label: _t("View Log"),
-                callback: this.widget_parent.on_sidebar_view_log,
+                callback: view.on_sidebar_view_log,
                 classname: 'oe_hide oe_sidebar_view_log'
             }
         ]);
+
+        if (session.connection.debug) {
+            this.add_section("Debug", 'debug');
+            if (action && action.id) {
+                this.add_items('debug', [{
+                    label: "Edit Action",
+                    callback: function() {
+                        view.on_sidebar_edit_resource(action.type, action.id);
+                    }
+                }]);
+            }
+            if (view_manager.searchview && view_manager.searchview.view_id) {
+                this.add_items('debug', [{
+                    label: "Edit SearchView",
+                    callback: function() {
+                        view.on_sidebar_edit_resource('ir.ui.view', view_manager.searchview.view_id);
+                    }
+                }]);
+            }
+        }
     },
 
     add_toolbar: function(toolbar) {
@@ -993,7 +1040,14 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
         console.log('Todo');
     },
     on_sidebar_customize_object: function() {
-        console.log('Todo');
+        var self = this;
+        this.rpc('/web/dataset/search_read', {
+            model: 'ir.model',
+            fields: ['id'],
+            domain: [['model', '=', self.dataset.model]]
+        }, function (result) {
+            self.on_sidebar_edit_resource('ir.model', result.ids[0]);
+        });
     },
     on_sidebar_import: function() {
         var import_view = new session.web.DataImport(this, this.dataset);
@@ -1013,6 +1067,27 @@ session.web.View = session.web.Widget.extend(/** @lends session.web.View# */{
             view_mode : "list"
         });
     },
+    on_sidebar_edit_resource: function(model, id, domain) {
+        var action = {
+            res_model : model,
+            type : 'ir.actions.act_window',
+            view_type : 'form',
+            view_mode : 'form',
+            target : 'new',
+            flags : {
+                action_buttons : true
+            }
+        }
+        if (id) {
+            action.res_id = id,
+            action.views = [[false, 'form']];
+        } else if (domain) {
+            action.views = [[false, 'list'], [false, 'form']];
+            action.domain = domain;
+            action.flags.views_switcher = true;
+        }
+        this.do_action(action);
+    },
     on_sidebar_view_log: function() {
     },
     sidebar_context: function () {
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index a75101f9867..82c412318c0 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -460,7 +460,7 @@
         
     
     
-         
     
     
@@ -726,7 +726,6 @@
         
             
@@ -863,15 +862,15 @@
         t-att-name="widget.name"
         t-att-id="widget.element_id"
         t-attf-class="field_#{widget.type} #{_(['integer', 'float', 'float_time']).contains(widget.type) ? 'oe-number' : ''}"
-        t-attf-style="width: #{widget.field.translate ? '99' : '100'}%"
+        style="width: 100%"
     />
-    
+    
 
 
     
+ style="width: 100%">
@@ -880,7 +879,7 @@ -
+ @@ -894,7 +893,7 @@ -
+ @@ -910,9 +909,9 @@ t-att-name="widget.name" t-att-id="widget.element_id" t-attf-class="field_#{widget.type}" - t-attf-style="width: #{widget.field.translate ? '99' : '100'}%" + style="width: 100%" > - +
@@ -1413,10 +1412,8 @@ .replaceAll(this) .after($(document.createElement('td')).append( $(document.createElement('button')).attr({ - 'class': 'oe-edit-row-save', 'type': 'button'}).text('Save'))) - .before($(document.createElement('td')).append( - $(document.createElement('button')).attr({ - 'class': 'oe-edit-row-cancel', 'type': 'button'}).text('Cancel'))) + 'class': 'oe-edit-row-save', 'type': 'button'}) + .html(' '))) .unwrap(); diff --git a/addons/web_calendar/po/de.po b/addons/web_calendar/po/de.po index 6e1f497efda..4a492b22e8f 100644 --- a/addons/web_calendar/po/de.po +++ b/addons/web_calendar/po/de.po @@ -8,22 +8,22 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-05 11:50+0100\n" -"PO-Revision-Date: 2011-10-10 12:36+0000\n" -"Last-Translator: Felix Schubert \n" +"PO-Revision-Date: 2011-12-08 08:35+0000\n" +"Last-Translator: Ferdinand @ Camptocamp \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-12-06 05:59+0000\n" -"X-Generator: Launchpad (build 14435)\n" +"X-Launchpad-Export-Date: 2011-12-09 05:17+0000\n" +"X-Generator: Launchpad (build 14450)\n" #: addons/web_calendar/static/src/js/calendar.js:409 msgid "Responsible" -msgstr "" +msgstr "Verantwortlich" #: addons/web_calendar/static/src/js/calendar.js:438 msgid "Navigator" -msgstr "" +msgstr "Browser" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/hr.po b/addons/web_calendar/po/hr.po index 990fcf1170c..3f2d41bad94 100644 --- a/addons/web_calendar/po/hr.po +++ b/addons/web_calendar/po/hr.po @@ -8,22 +8,22 @@ msgstr "" "Project-Id-Version: openerp-web\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-12-05 11:50+0100\n" -"PO-Revision-Date: 2011-11-28 12:04+0000\n" +"PO-Revision-Date: 2011-12-08 16:34+0000\n" "Last-Translator: Goran Kliska \n" "Language-Team: Croatian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-12-06 05:59+0000\n" -"X-Generator: Launchpad (build 14435)\n" +"X-Launchpad-Export-Date: 2011-12-09 05:17+0000\n" +"X-Generator: Launchpad (build 14450)\n" #: addons/web_calendar/static/src/js/calendar.js:409 msgid "Responsible" -msgstr "" +msgstr "Odgovoran" #: addons/web_calendar/static/src/js/calendar.js:438 msgid "Navigator" -msgstr "" +msgstr "Navigator" #: addons/web_calendar/static/src/xml/web_calendar.xml:0 msgid " " diff --git a/addons/web_calendar/po/uk.po b/addons/web_calendar/po/uk.po new file mode 100644 index 00000000000..9cb7cae4797 --- /dev/null +++ b/addons/web_calendar/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation for openerp-web +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openerp-web package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openerp-web\n" +"Report-Msgid-Bugs-To: FULL NAME \n" +"POT-Creation-Date: 2011-12-05 11:50+0100\n" +"PO-Revision-Date: 2011-12-07 16:53+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Ukrainian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2011-12-08 06:06+0000\n" +"X-Generator: Launchpad (build 14443)\n" + +#: addons/web_calendar/static/src/js/calendar.js:409 +msgid "Responsible" +msgstr "" + +#: addons/web_calendar/static/src/js/calendar.js:438 +msgid "Navigator" +msgstr "" + +#: addons/web_calendar/static/src/xml/web_calendar.xml:0 +msgid " " +msgstr "" diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 75b168ccf5a..9f2c8602cab 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -25,6 +25,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ '#ff8e00', '#ff0000', '#b0008c', '#9000ff', '#0078ff', '#00ff00', '#e6ff00', '#ffff00', '#905000', '#9b0000', '#840067', '#510090', '#0000c9', '#009b00', '#9abe00', '#ffc900' ]; this.color_map = {}; + this.last_search = []; }, start: function() { this._super(); @@ -106,9 +107,12 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ scheduler.config.api_date = "%Y-%m-%d %H:%i"; scheduler.config.multi_day = true; //Multi day events are not rendered in daily and weekly views scheduler.config.start_on_monday = true; + scheduler.config.time_step = 15; scheduler.config.scroll_hour = 8; scheduler.config.drag_resize = true; scheduler.config.drag_create = true; + scheduler.config.mark_now = true; + scheduler.config.day_date = '%l %j'; scheduler.init('openerp_scheduler', null, this.mode || 'month'); @@ -120,6 +124,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ scheduler.attachEvent('onEventDeleted', this.do_delete_event); scheduler.attachEvent('onEventChanged', this.do_save_event); scheduler.attachEvent('onDblClick', this.do_edit_event); + scheduler.attachEvent('onClick', this.do_edit_event); scheduler.attachEvent('onBeforeLightbox', this.do_edit_event); if (this.options.sidebar) { @@ -162,9 +167,6 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ for (var e = 0; e < events.length; e++) { var evt = events[e]; if (!evt[this.date_start]) { - if (this.session.debug) { - this.do_warn("Start date is not defined for event :", evt['id']); - } break; } @@ -333,10 +335,14 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ return data; }, do_search: function(domain, context, group_by) { - var self = this; + var self = this + if (!domain) { + this.do_search.apply(this, this.last_search); + } else { + this.last_search = [domain, context, group_by]; + } scheduler.clearAll(); $.when(this.has_been_loaded).then(function() { - // TODO: handle non-empty results.group_by with read_group self.dataset.read_slice(_.keys(self.fields), { offset: 0, limit: self.limit diff --git a/addons/web_calendar/static/src/xml/web_calendar.xml b/addons/web_calendar/static/src/xml/web_calendar.xml index c9e5f628b94..53bb7109786 100644 --- a/addons/web_calendar/static/src/xml/web_calendar.xml +++ b/addons/web_calendar/static/src/xml/web_calendar.xml @@ -1,6 +1,5 @@