diff options
| author | Vishmita <vja@tinyerp.com> | 2012-11-19 18:27:00 +0530 |
|---|---|---|
| committer | Vishmita <vja@tinyerp.com> | 2012-11-19 18:27:00 +0530 |
| commit | c8f1dc402d4c5ba7d74e825ba00c087e506f83a1 (patch) | |
| tree | 8639c60ca8a174c3f5983383acd9d9bdc94cc687 /addons/web/static/src | |
| parent | 367e3a90cc61fdb492d51c26f6a4ba0ad8c8f4ea (diff) | |
| parent | e17c6b40d9ae463c1e3bbbd9836365284176615a (diff) | |
[MERGE]Merge lp:~openerp-dev/openerp-web/trunk-improve-little-big-details.
bzr revid: vja@tinyerp.com-20121119125700-z5li5h7oo7237ify
Diffstat (limited to 'addons/web/static/src')
21 files changed, 850 insertions, 84 deletions
diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 3f422fd77a9..057a5535a61 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -3028,12 +3028,57 @@ div.ui-widget-overlay { border-radius: 3px; } -.resolution table { +.resolution { + width: 350px; + background-color: white; + margin-bottom: 15px; + margin-left: 5px; + position: relative; + z-index: 10; +} +.resolution .res { + display: table; width: 100%; - line-height: 20px; } -.resolution table td { - valign: middle; + +div.res { + border: 1px solid; +} + +.resolution .res > div:not(.simtext) { + border-bottom: 1px solid; + height: 70px; + clear: both; +} + +.res .simtext { + border-bottom: 0px; + padding: 5px; + height: auto; +} + +.simtext span { + font-size: 8px; + color: grey; +} + +.resolution .res div div { + display: inline; + position: absolute; + padding-top: 30px; + padding-left: 10px; +} + +.res img { + width: 150px; + height: 40px; + padding-top: 20px; + padding-left: 5px; +} +.res span a { + font-size: 10px; + padding-right: 5px; +>>>>>>> MERGE-SOURCE } @media print { diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c0a7e1c3165..e9648e43fe6 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -2400,11 +2400,49 @@ div.ui-widget-overlay @include radius(3px) // }}} -.resolution table - width: 100% - line-height: 20px - td - valign: middle +.resolution + width: 350px + background-color: white + margin-bottom: 15px + margin-left: 5px + position: relative + z-index: 10 + .res + display: table + width: 100% + +div.res + border: 1px solid + +.resolution .res > div:not(.simtext) + border-bottom: 1px solid + height: 70px + clear: both + +.res .simtext + border-bottom: 0px + padding: 5px + height: auto + +.simtext span + font-size: 8px + color: grey + +.resolution .res div div + display: inline + position: absolute + padding-top: 30px + padding-left: 10px + +.res + img + width: 150px + height: 40px + padding-top: 20px + padding-left: 5px + span a + font-size: 10px + padding-right: 5px @media print .openerp diff --git a/addons/web/static/src/img/OpenERP_Vector_Logo_2011.svg b/addons/web/static/src/img/OpenERP_Vector_Logo_2011.svg new file mode 100644 index 00000000000..ed10906240f --- /dev/null +++ b/addons/web/static/src/img/OpenERP_Vector_Logo_2011.svg @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + width="808.39862" + height="160.13882" + id="svg2" + xml:space="preserve" + inkscape:version="0.48.0 r9654" + sodipodi:docname="openerp_slogan_2011.svg"><metadata + id="metadata37"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1366" + inkscape:window-height="717" + id="namedview35" + showgrid="false" + inkscape:zoom="1.1287411" + inkscape:cx="366.36036" + inkscape:cy="42.587126" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="svg2" + fit-margin-top="0" + fit-margin-left="0" + fit-margin-right="0" + fit-margin-bottom="0" /><defs + id="defs6" /><g + id="g3066" + transform="translate(-53.15667,-272.78409)"><text + sodipodi:linespacing="125%" + id="text3062" + y="424.81061" + x="195.13553" + style="font-size:39px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#999999;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Bold" + xml:space="preserve"><tspan + y="424.81061" + x="195.13553" + id="tspan3064" + sodipodi:role="line">Source Business Applications </tspan></text> +<g + transform="matrix(0.125,0,0,-0.125,53.156566,432.78409)" + id="g14"><path + d="m 936.855,65.9766 c -2.363,3.8281 0.926,24.3281 7.317,45.5544 16.215,53.879 137.058,580.692 147.888,644.688 4.89,28.906 7.73,66.707 6.32,84 -2.31,28.222 -4.61,31.219 -22.49,29.203 -10.96,-1.238 -32.76,-11.137 -48.43,-22 -33.925,-23.508 -37.581,-24.016 -41.413,-5.754 -3.59,17.094 112.043,106.23 176.523,136.078 34.98,16.188 46.27,18.199 62,11.031 24.31,-11.074 24.75,-34.379 2.62,-137.109 -30.45,-141.328 -30.75,-139.957 15.49,-69.859 72.12,109.328 169.17,188.429 252.36,205.699 81.03,16.822 108.77,-14.793 108.77,-123.922 0,-116.191 -43.5,-255.977 -100.63,-323.41 -30.36,-35.821 -141.45,-118.36 -187.37,-139.199 -27.58,-12.524 -52.26,-16.293 -105.59,-16.129 l -69.58,0.211 -24.56,-101.516 c -13.5,-55.832 -27.19,-122.535 -30.41,-148.227 l -5.86,-46.7144 -54.26,-10.0078 C 995.711,73.0859 964.512,66.4297 956.227,63.8008 947.938,61.168 939.223,62.1484 936.855,65.9766 z M 1346.66,471.574 c 52.86,47.758 108.42,200.867 117.54,323.906 7.61,102.622 -23.4,127.825 -96.68,78.575 -79.08,-53.153 -158.04,-176.297 -186.2,-290.387 -29.39,-119.063 -30.21,-106.648 8.27,-124.113 20.91,-9.493 52.11,-15.606 80.2,-15.711 41.4,-0.16 49.05,2.605 76.87,27.73 z M 283.418,387.727 c -24.418,3.832 -65.816,14.968 -92,24.753 -65.555,24.493 -138.168,96.891 -162.5,162.008 -51.2188,137.078 -33.22659,319.461 44.6836,452.942 64.4374,110.4 180.4144,195.12 314.2104,229.53 60.903,15.66 192.704,17.51 251.079,3.52 202.371,-48.5 296.117,-220.27 248.394,-455.148 C 880.391,771.418 860.137,713.066 842.273,675.668 815.594,619.816 797.465,595.48 740.801,539.461 638.582,438.402 537.984,393.801 391.812,384.734 c -35.199,-2.183 -83.976,-0.836 -108.394,2.993 z m 227.184,71.808 c 74.336,35.715 143.003,125.078 181.019,235.574 41.453,120.493 50.453,302.95 19.348,392.281 -17.606,50.56 -75.008,109.11 -120.086,122.5 -52.723,15.66 -139.766,12.29 -192.524,-7.45 C 278.254,1157.5 193.234,997.875 172.461,778.324 156.203,606.477 194.312,498.582 286.875,454.41 c 36.105,-17.23 49.434,-19.18 112.937,-16.523 54.489,2.277 81.434,7.543 110.79,21.648 z M 1807.26,386.848 c -70.7,17.875 -107.45,68.386 -107.45,147.683 0,94.422 41.04,236.883 87.83,304.895 62.36,90.629 235.23,171.114 319.04,148.547 60.25,-16.223 91.25,-77.039 73.28,-143.758 -20.64,-76.653 -119.11,-143.781 -261.5,-178.274 -69.11,-16.742 -73.62,-19.113 -78,-41.019 -13.02,-65.098 2.03,-128.215 36.29,-152.207 40.12,-28.102 135.34,-9.328 217.73,42.926 20.84,13.214 39.14,24.027 40.68,24.027 1.53,0 4.54,-6.715 6.69,-14.922 3.08,-11.797 -11.38,-24.23 -69.07,-59.383 -40.13,-24.453 -91.1,-51.586 -113.26,-60.289 -47.34,-18.597 -117.56,-27 -152.26,-18.226 z m 121.96,312.015 c 76.66,29.575 133.89,89.364 138.65,144.867 5.31,61.887 -13.58,87.938 -63.78,87.938 -59.06,0 -106.91,-62.43 -137.19,-178.977 -8.15,-31.363 -14.88,-61.593 -14.95,-67.175 -0.16,-11.516 23.35,-7.457 77.27,13.347 z m 700.59,-306.922 c -26.89,18.875 -23.17,74.243 14.5,215.727 17.58,66 38.07,147.859 45.53,181.91 12.79,58.305 12.79,62.703 -0.07,75.555 -12.68,12.687 -15.56,12.734 -40.87,0.664 -44.06,-21.008 -82.4,-59.617 -129.47,-130.367 -54.02,-81.188 -79.91,-143.239 -103.35,-247.762 l -17.95,-80 -49.42,-5.543 c -27.18,-3.051 -56.2,-7.695 -64.49,-10.328 -8.28,-2.629 -16.79,-1.934 -18.91,1.547 -2.12,3.476 11.91,61.246 31.19,128.375 43.41,151.234 68.87,274.105 65.71,317.172 -2.1,28.652 -4.67,32.535 -20.44,30.863 -9.92,-1.051 -32.7,-11.613 -50.61,-23.473 -27.09,-17.918 -33.81,-19.621 -39.84,-10.086 -4,6.309 -7.24,13.274 -7.21,15.473 0.09,8.66 152.88,113.422 188.2,129.043 30.8,13.629 41.13,14.961 57.62,7.449 19,-8.656 19.82,-11.64 15.17,-54.824 -2.71,-25.117 -17.33,-90.652 -32.48,-145.633 -15.15,-54.976 -26.58,-100.933 -25.39,-102.121 1.19,-1.187 16,20.262 32.91,47.66 40.86,66.196 138.67,167.524 201.73,208.981 41.24,31.488 78.49,42.199 93.83,46.433 31.29,8.641 54.62,0.219 67.85,-24.496 10.24,-19.137 2.96,-58.43 -44.58,-240.492 -65.25,-249.918 -63.01,-270.895 23.14,-216.266 34.98,22.188 37.93,22.789 45.19,9.211 6.6,-12.316 -0.97,-20.613 -49.85,-54.648 -103.55,-72.086 -156.52,-91.86 -187.64,-70.024" + id="path16" + style="fill:#db2925;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 4036.6,551.477 c 17.5,0 28.98,2.461 34.45,7.382 6.02,5.469 10.94,16.407 14.77,32.813 l 21.33,0 -2.67,-198.953 c 0,0 -51.48,0.437 -67.88,0.437 l -801.44,0 0,22.149 c 17.5,4.375 28.71,9.57 33.63,15.586 5.47,6.562 8.2,17.5 8.2,32.812 l 0,740.747 c 0,16.4 -2.73,27.61 -8.2,33.63 -5.47,6.56 -16.68,11.76 -33.63,15.58 l 0,21.33 791.6,0 69.6,0.29 0.94,-197.98 -22.14,0 c -3.84,16.4 -9.03,27.07 -15.59,31.99 -6.57,5.47 -17.5,8.2 -32.81,8.2 l -556.17,0 0,-193.592 354.37,0 c 17.5,0 28.99,2.461 34.45,7.383 5.47,4.922 10.39,15.86 14.77,32.813 l 21.33,0 0,-223.125 -21.33,0 c -3.28,15.859 -8.2,26.523 -14.77,31.992 -6.01,5.469 -17.5,8.203 -34.45,8.203 l -354.37,0 0,-229.687 566.01,0 m 343.71,-158.321 0,22.149 c 16.96,3.281 28.17,8.203 33.64,14.765 5.46,6.563 8.2,17.774 8.2,33.633 l 0,740.747 c 0,15.31 -2.74,26.25 -8.2,32.81 -4.93,6.56 -16.14,12.03 -33.64,16.4 l 0,21.33 554.53,0 c 114.85,0 203.99,-22.42 267.43,-67.26 63.43,-44.85 95.15,-107.46 95.15,-187.85 0,-66.177 -19.69,-120.864 -59.06,-164.068 -38.83,-42.656 -98.98,-74.921 -180.47,-96.796 L 5244.1,498.977 c 10.94,-15.86 23.24,-29.805 36.92,-41.836 14.21,-11.485 36.63,-25.43 67.26,-41.836 l 0,-22.149 -324.02,0 0,22.149 c 12.03,1.64 21.05,4.922 27.07,9.843 6.56,4.922 9.84,10.938 9.84,18.047 0,1.641 -2.19,7.11 -6.56,16.407 -4.38,9.296 -9.02,17.5 -13.95,24.609 l -184.57,269.883 -240.35,0 0,-290.391 c 0,-16.406 2.46,-27.617 7.38,-33.633 5.47,-6.015 16.96,-10.937 34.46,-14.765 l 0,-22.149 -277.27,0 m 501.21,730.894 -265.78,0 0,-241.988 272.35,0 c 80.39,0 137.53,9.571 171.44,28.711 34.45,19.688 51.68,51.68 51.68,95.977 0,42.66 -16.68,72.73 -50.04,90.23 -33.36,18.05 -93.24,27.07 -179.65,27.07 m 680.04,-730.894 0,22.149 c 16.96,3.281 28.17,8.203 33.64,14.765 5.46,6.563 8.2,17.774 8.2,33.633 l 0,740.747 c 0,15.31 -2.74,26.25 -8.2,32.81 -4.93,6.56 -16.14,12.03 -33.64,16.4 l 0,21.33 543.05,0 c 114.84,0 203.98,-22.42 267.42,-67.26 63.44,-44.85 95.15,-107.46 95.16,-187.85 -0.01,-82.036 -30.35,-146.841 -91.06,-194.419 -60.7,-47.578 -143.55,-71.367 -248.55,-71.367 l -330.59,0 0,-290.391 c 0,-16.406 2.46,-27.617 7.39,-33.633 5.46,-6.015 16.95,-10.937 34.45,-14.765 l 0,-22.149 -277.27,0 m 488.91,734.184 -253.48,0 0,-223.129 260.04,0 c 77.11,0 133.71,9.023 169.81,27.07 36.09,18.594 54.14,47.578 54.14,86.949 0,38.83 -17.5,66.72 -52.5,83.68 -35,16.95 -94.34,25.43 -178.01,25.43" + id="path18" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 2683.12,988.758 c -8.82,2.086 -16.08,12.122 -23.88,33.032 -14.04,37.63 -33.6,47.17 -67.6,32.96 -15.46,-6.45 -33.27,-8.3 -60.93,-6.32 l -39.09,2.79 -9.03,-19.03 c -4.97,-10.47 -9.12,-21.26 -9.22,-23.98 -0.31,-8.448 -28.78,-26.253 -38.85,-24.3 -17.57,3.406 -14.27,15.254 6.13,21.99 14.1,4.65 23.12,12.86 29.96,27.26 5.37,11.33 8.89,21.14 7.82,21.79 -38.82,23.36 -60.64,22.62 -166.11,-5.68 -198.05,-53.122 -221.21,-56.754 -315.59,-49.5 -4.09,0.32 -10.14,7.69 -13.44,16.39 -12.12,31.88 33.94,125.28 82.12,166.52 72.51,62.06 176.61,49.13 286.94,-35.64 43.24,-33.22 72.91,-40.86 66.72,-17.19 -5.55,21.21 8.22,62.48 27.75,83.19 20.2,21.43 62.98,36.84 152.84,55.05 73.31,14.86 94.8,5.1 104.39,-47.43 6.59,-36.05 15.78,-37.8 43.47,-8.26 30.5,32.54 50.14,40.8 89.36,37.55 36.44,-3.02 74.35,-20.15 107.62,-48.63 l 23.99,-20.54 12.28,27.86 c 6.75,15.32 19.04,37.64 27.3,49.61 l 15.02,21.75 18.23,-12.55 c 10.04,-6.9 47.1,-41.62 82.38,-77.16 35.28,-35.54 80.54,-79.28 100.58,-97.19 31.42,-28.07 36.45,-35.35 36.45,-52.75 0,-20.95 -8.41,-34.18 -21.73,-34.18 -4.25,0 -17.88,16.05 -30.28,35.67 -24.58,38.87 -174.17,183.86 -181.54,175.95 -2.38,-2.54 -10.21,-18.52 -17.41,-35.5 l -13.1,-30.88 18.32,-35.54 c 19.69,-38.17 21.47,-48.2 12.67,-71.35 l -5.66,-14.9 -20.82,14.12 c -29.7,20.16 -63.86,31.16 -110.41,35.57 -33.54,3.18 -50.98,9.3 -101.36,35.61 l -60.86,31.77 -19.74,-21.55 c -10.86,-11.86 -19.03,-22.02 -18.17,-22.58 0.86,-0.56 13.51,-5.44 28.1,-10.84 21.75,-8.05 29.66,-15.31 43.91,-40.27 9.77,-17.12 24.96,-34.33 34.69,-39.32 9.53,-4.88 18.46,-9.57 19.85,-10.43 1.39,-0.85 0.01,-4.063 -3.06,-7.134 -3.22,-3.222 -12.91,-3.621 -22.92,-0.945 -13.35,3.57 -19.42,10.289 -26.41,29.179 -14.27,38.65 -33.01,53.35 -79.12,62.05 -25.74,4.85 -43.77,5.62 -50.32,2.14 -13.42,-7.14 -12.87,-10.24 2.86,-16.05 7.18,-2.66 19.64,-17.66 27.69,-33.34 8.05,-15.68 20.54,-31.1 27.76,-34.27 7.22,-3.16 13.12,-7.545 13.12,-9.732 0,-2.188 -1.66,-8.61 -23.67,-4.84" + id="path20" + style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 124.984,258.281 c -17.875,0 -31.7379,-6.601 -41.5895,-19.804 -9.8515,-13.204 -14.7773,-31.789 -14.7773,-55.758 0,-23.867 4.9258,-42.403 14.7773,-55.606 9.8516,-13.203 23.7145,-19.804 41.5895,-19.804 17.977,0 31.891,6.601 41.743,19.804 9.851,13.203 14.777,31.739 14.777,55.606 0,23.969 -4.926,42.554 -14.777,55.758 -9.852,13.203 -23.766,19.804 -41.743,19.804 m 0,42.504 c 36.563,0 65.204,-10.461 85.922,-31.383 20.719,-20.922 31.078,-49.816 31.078,-86.683 0,-36.766 -10.359,-65.61 -31.078,-86.5315 C 190.188,75.2656 161.547,64.8047 124.984,64.8047 88.5234,64.8047 59.8828,75.2656 39.0625,96.1875 18.3438,117.109 7.98438,145.953 7.98438,182.719 c 0,36.867 10.35942,65.761 31.07812,86.683 20.8203,20.922 49.4609,31.383 85.9215,31.383" + id="path22" + style="fill:#969696;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 338.266,93.9023 0,-89.57808 -54.539,0 0,235.52378 54.539,0 0,-24.985 c 7.515,9.953 15.843,17.266 24.984,21.938 9.141,4.773 19.652,7.16 31.535,7.16 21.024,0 38.289,-8.379 51.797,-25.137 13.508,-16.656 20.262,-38.136 20.262,-64.441 0,-26.305 -6.754,-47.836 -20.262,-64.5939 -13.508,-16.6563 -30.773,-24.9844 -51.797,-24.9844 -11.883,0 -22.394,2.3359 -31.535,7.0078 -9.141,4.7734 -17.469,12.1367 -24.984,22.0898 m 36.257,110.4497 c -11.679,0 -20.668,-4.317 -26.964,-12.95 -6.196,-8.531 -9.293,-20.871 -9.293,-37.019 0,-16.149 3.097,-28.539 9.293,-37.172 6.296,-8.531 15.285,-12.797 26.964,-12.797 11.68,0 20.567,4.266 26.661,12.797 6.195,8.531 9.293,20.922 9.293,37.172 0,16.25 -3.098,28.64 -9.293,37.172 -6.094,8.531 -14.981,12.797 -26.661,12.797" + id="path24" + style="fill:#969696;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 677.688,154.992 0,-15.539 -127.512,0 c 1.32,-12.797 5.941,-22.394 13.863,-28.793 7.922,-6.398 18.992,-9.598 33.211,-9.598 11.477,0 23.207,1.676 35.191,5.028 12.086,3.453 24.477,8.633 37.172,15.539 l 0,-42.047 c -12.898,-4.875 -25.797,-8.5312 -38.695,-10.9687 -12.898,-2.5391 -25.797,-3.8086 -38.695,-3.8086 -30.875,0 -54.895,7.8203 -72.059,23.4609 -17.062,15.7424 -25.594,37.7814 -25.594,66.1174 0,27.828 8.379,49.715 25.137,65.66 16.859,15.945 40.016,23.918 69.469,23.918 26.812,0 48.242,-8.074 64.289,-24.223 16.148,-16.148 24.223,-37.73 24.223,-64.746 m -56.063,18.129 c 0,10.359 -3.047,18.688 -9.141,24.984 -5.992,6.399 -13.863,9.598 -23.613,9.598 -10.562,0 -19.144,-2.996 -25.746,-8.988 -6.602,-5.891 -10.715,-14.422 -12.34,-25.594 l 70.84,0" + id="path26" + style="fill:#969696;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /><path + d="m 890.359,173.121 0,-103.8983 -54.843,0 0,79.5233 c 0,14.727 -0.356,24.883 -1.067,30.469 -0.609,5.586 -1.726,9.699 -3.351,12.34 -2.133,3.554 -5.028,6.297 -8.684,8.226 -3.656,2.031 -7.82,3.047 -12.492,3.047 -11.375,0 -20.313,-4.418 -26.813,-13.254 -6.5,-8.734 -9.75,-20.871 -9.75,-36.41 l 0,-83.9413 -54.539,0 0,170.6253 54.539,0 0,-24.985 c 8.227,9.953 16.961,17.266 26.203,21.938 9.243,4.773 19.45,7.16 30.622,7.16 19.703,0 34.632,-6.043 44.789,-18.129 10.257,-12.086 15.386,-29.656 15.386,-52.711" + id="path28" + style="fill:#969696;fill-opacity:1;fill-rule:nonzero;stroke:none" + inkscape:connector-curvature="0" /></g></g><text + xml:space="preserve" + style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" + x="16.832809" + y="194.55176" + id="text3044" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3046" + x="16.832809" + y="194.55176" /></text> +<text + xml:space="preserve" + style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans" + x="2.6577258" + y="199.86743" + id="text3048" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3050" + x="2.6577258" + y="199.86743" /></text> +<text + xml:space="preserve" + style="font-size:36px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#999999;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Bold" + x="334.00031" + y="185.69235" + id="text3056" + sodipodi:linespacing="125%"><tspan + sodipodi:role="line" + id="tspan3058" + x="334.00031" + y="185.69235" /><tspan + sodipodi:role="line" + x="334.00031" + y="230.69235" + id="tspan3060" /></text> +</svg>
\ No newline at end of file diff --git a/addons/web/static/src/img/logo1.png b/addons/web/static/src/img/logo1.png Binary files differnew file mode 100644 index 00000000000..d6dbd9d83d1 --- /dev/null +++ b/addons/web/static/src/img/logo1.png diff --git a/addons/web/static/src/img/openerp_big.png b/addons/web/static/src/img/openerp_big.png Binary files differnew file mode 100644 index 00000000000..aa2d6c69711 --- /dev/null +++ b/addons/web/static/src/img/openerp_big.png diff --git a/addons/web/static/src/img/openerp_community.png b/addons/web/static/src/img/openerp_community.png Binary files differnew file mode 100644 index 00000000000..aac989117e0 --- /dev/null +++ b/addons/web/static/src/img/openerp_community.png diff --git a/addons/web/static/src/img/openerp_partner_gold.png b/addons/web/static/src/img/openerp_partner_gold.png Binary files differnew file mode 100644 index 00000000000..6726ad489c9 --- /dev/null +++ b/addons/web/static/src/img/openerp_partner_gold.png diff --git a/addons/web/static/src/img/openerp_partner_gold.svg b/addons/web/static/src/img/openerp_partner_gold.svg new file mode 100644 index 00000000000..48b400a1122 --- /dev/null +++ b/addons/web/static/src/img/openerp_partner_gold.svg @@ -0,0 +1,97 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" + "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> +<svg version="1.0" xmlns="http://www.w3.org/2000/svg" + width="852.000000pt" height="196.000000pt" viewBox="0 0 852.000000 196.000000" + preserveAspectRatio="xMidYMid meet"> +<metadata> +Created by potrace 1.10, written by Peter Selinger 2001-2011 +</metadata> +<g transform="translate(0.000000,196.000000) scale(0.100000,-0.100000)" +fill="#000000" stroke="none"> +<path d="M3928 1761 l-32 -58 -50 36 c-41 29 -60 36 -110 39 -59 4 -64 2 -106 +-33 l-45 -37 -12 33 c-23 59 -28 64 -73 67 -50 4 -168 -22 -221 -49 -39 -19 +-69 -69 -69 -113 0 -35 -13 -33 -84 13 -138 90 -239 110 -321 63 -49 -28 -108 +-106 -130 -173 -20 -60 -11 -76 43 -81 37 -3 36 -3 -23 -21 -146 -45 -256 +-132 -306 -243 -65 -142 -91 -342 -55 -411 34 -67 106 -99 198 -89 68 7 134 +33 231 90 86 51 112 75 99 88 -7 7 -29 0 -68 -22 -72 -40 -136 -60 -196 -60 +-53 0 -81 19 -99 68 -12 32 -14 142 -2 152 4 5 60 24 123 44 216 67 319 167 +296 288 -10 52 -45 88 -101 102 l-48 13 59 6 c32 4 104 18 159 33 55 14 129 +32 164 39 114 24 164 -4 101 -57 -19 -15 -31 -31 -27 -34 4 -4 -12 -18 -35 +-32 -85 -47 -188 -127 -188 -144 0 -24 9 -23 68 8 28 14 56 23 63 19 21 -14 3 +-130 -56 -364 -31 -123 -54 -225 -52 -228 3 -2 41 1 84 7 l79 12 28 111 c31 +129 83 243 156 340 78 104 180 158 188 100 2 -12 -19 -116 -47 -230 -65 -268 +-69 -325 -28 -344 37 -17 97 5 197 72 62 41 90 66 90 80 0 25 -3 24 -59 -8 +-30 -16 -55 -24 -66 -19 -24 9 -19 36 50 323 30 126 55 237 55 246 0 9 -9 26 +-20 37 -11 11 -20 22 -20 23 0 7 -116 122 -133 132 -16 9 -15 12 1 33 l19 24 +71 -36 c40 -20 104 -43 142 -51 39 -8 89 -24 112 -36 33 -17 42 -18 49 -7 14 +21 10 44 -13 93 l-22 45 21 42 21 43 131 -133 c73 -73 135 -130 140 -128 5 3 +11 16 15 28 5 20 -16 45 -140 166 -80 78 -149 142 -154 142 -5 0 -24 -26 -42 +-59z m-331 -206 c12 -8 30 -30 39 -48 9 -17 21 -35 27 -38 5 -4 -7 -12 -26 +-18 -89 -30 -245 -168 -338 -301 -24 -33 -44 -59 -45 -57 -1 1 13 65 32 142 +42 171 44 212 10 221 -24 6 -25 6 -9 40 15 30 21 34 57 34 23 0 64 3 93 6 l51 +7 22 -42 c20 -40 44 -60 57 -48 3 3 -15 30 -41 60 -25 30 -46 58 -46 62 0 12 +91 -4 117 -20z m-843 -197 c9 -13 16 -43 16 -69 0 -79 -63 -148 -179 -195 -71 +-30 -81 -30 -81 0 0 37 39 156 67 204 35 60 67 82 119 82 33 0 46 -5 58 -22z"/> +<path d="M4230 1802 c0 -9 10 -22 23 -27 l22 -10 3 -497 2 -497 -25 -17 c-14 +-9 -25 -23 -25 -30 0 -12 87 -14 545 -14 l545 0 0 125 c0 104 -2 125 -15 125 +-8 0 -15 -4 -15 -9 0 -5 -7 -17 -16 -25 -13 -14 -62 -16 -380 -16 l-364 0 0 +140 0 140 240 0 240 0 12 -25 c24 -52 33 -20 36 123 2 123 0 142 -13 142 -9 0 +-20 -11 -25 -25 l-10 -25 -240 0 -240 0 0 115 0 115 365 0 365 0 12 -25 c6 +-14 17 -25 25 -25 10 0 13 28 13 130 l0 130 -540 0 c-509 0 -540 -1 -540 -18z"/> +<path d="M5660 1803 c0 -10 10 -23 23 -28 l22 -10 3 -503 2 -502 -25 -10 c-14 +-5 -25 -16 -25 -25 0 -13 25 -15 175 -15 142 0 175 3 175 14 0 7 -11 21 -25 +30 l-25 16 0 195 0 195 148 0 149 0 60 -87 c154 -224 193 -285 193 -299 0 -8 +-12 -19 -26 -24 -14 -6 -24 -16 -21 -23 3 -9 55 -13 205 -15 190 -2 202 -1 +202 16 0 11 -15 27 -37 39 -21 12 -50 34 -64 50 -53 57 -251 345 -243 352 5 4 +32 16 59 26 133 48 212 145 223 271 13 164 -97 294 -283 335 -29 6 -218 13 +-457 16 -393 5 -408 4 -408 -14z m792 -194 c37 -8 63 -22 87 -46 32 -32 33 +-36 29 -93 -3 -45 -10 -66 -28 -85 -43 -46 -101 -55 -352 -55 l-228 0 0 145 0 +145 220 0 c125 0 242 -5 272 -11z"/> +<path d="M7140 1801 c0 -12 6 -21 15 -21 8 0 19 -9 25 -19 6 -13 10 -190 10 +-505 l0 -486 -25 -16 c-14 -9 -25 -23 -25 -30 0 -11 33 -14 175 -14 150 0 175 +2 175 15 0 9 -11 20 -25 25 l-25 10 0 200 0 200 221 0 c254 0 340 10 426 51 +244 116 246 442 2 553 -95 44 -136 48 -551 53 l-398 5 0 -21z m702 -181 c141 +-14 188 -44 188 -122 0 -118 -85 -147 -437 -148 l-153 0 0 140 0 140 153 0 +c83 0 196 -5 249 -10z"/> +<path d="M730 1801 c-126 -18 -246 -78 -348 -175 -60 -57 -81 -86 -117 -160 +-57 -119 -80 -229 -72 -351 6 -87 23 -159 48 -207 84 -157 280 -234 509 -198 +153 24 251 76 372 196 81 80 107 121 150 235 30 79 32 92 32 219 1 161 -17 +217 -91 301 -88 97 -182 138 -333 144 -52 2 -120 0 -150 -4z m215 -80 c52 -24 +98 -74 127 -136 21 -45 23 -65 23 -190 -1 -169 -20 -265 -76 -380 -80 -165 +-174 -235 -324 -243 -101 -5 -144 8 -201 60 -82 75 -110 222 -80 415 38 248 +137 421 270 472 70 27 205 28 261 2z"/> +<path d="M1625 1432 c-123 -68 -241 -172 -196 -172 5 0 32 12 59 26 28 14 55 +23 61 19 30 -18 -1 -193 -131 -738 -33 -141 -59 -260 -55 -263 3 -3 43 2 89 +11 l85 17 17 92 c9 50 27 132 38 182 l21 91 93 5 c111 6 151 24 274 118 87 68 +118 107 154 197 42 101 58 194 54 300 -3 91 -4 96 -32 120 -26 22 -36 25 -78 +20 -97 -12 -219 -103 -321 -239 -28 -39 -53 -65 -55 -60 -2 6 6 54 17 106 42 +192 20 231 -94 168z m385 -122 c39 -93 -51 -411 -140 -497 -30 -30 -40 -33 +-92 -33 -68 0 -138 25 -138 49 1 41 43 183 74 246 71 144 188 265 257 265 20 +0 30 -7 39 -30z"/> +<path d="M4276 485 c24 -52 44 -99 44 -105 0 -6 -24 -56 -52 -113 -29 -56 -54 +-105 -56 -109 -2 -5 906 -8 2018 -8 1112 0 2020 3 2018 8 -2 4 -27 53 -56 109 +-28 57 -52 107 -52 113 0 6 20 53 44 105 l45 95 -1999 0 -1999 0 45 -95z +m1144 -34 c0 -16 -8 -20 -42 -23 -43 -3 -43 -3 -43 -43 0 -36 3 -40 28 -43 28 +-3 38 15 12 24 -30 12 -16 34 20 34 35 0 35 0 35 -44 0 -31 -5 -46 -16 -50 +-32 -12 -82 -5 -108 15 -21 16 -26 29 -26 64 0 56 32 85 96 85 37 0 44 -3 44 +-19z m179 -7 c46 -59 10 -144 -61 -144 -62 1 -98 55 -78 116 14 41 33 53 82 +54 28 0 41 -6 57 -26z m346 1 c27 -26 32 -60 14 -98 -14 -31 -48 -47 -99 -47 +l-38 0 -4 81 c-2 44 -1 83 1 85 2 2 26 4 53 4 39 0 54 -5 73 -25z m229 9 c33 +-33 7 -94 -41 -94 -19 0 -23 -5 -23 -30 0 -25 -4 -30 -25 -30 -25 0 -25 1 -25 +85 l0 85 49 0 c32 0 55 -6 65 -16z m162 -69 c13 -44 23 -81 24 -82 0 -2 -11 +-3 -24 -3 -16 0 -27 7 -31 20 -4 11 -15 20 -27 20 -11 0 -22 -8 -25 -20 -4 +-13 -14 -20 -30 -20 -18 0 -23 4 -19 18 3 9 12 44 22 77 21 78 21 77 56 73 29 +-3 32 -7 54 -83z m169 69 c11 -11 14 -24 10 -38 -10 -29 -10 -56 -1 -88 7 -24 +5 -28 -13 -28 -15 0 -25 9 -32 30 -14 38 -37 40 -35 3 1 -22 -4 -29 -21 -31 +-22 -3 -23 -1 -23 82 l0 86 49 0 c33 0 55 -6 66 -16z m293 -34 l22 -44 0 47 +c0 40 3 47 20 47 18 0 20 -7 20 -85 0 -82 -1 -85 -23 -85 -18 0 -29 12 -49 53 +l-27 52 0 -52 c-1 -46 -4 -53 -21 -53 -18 0 -20 7 -20 86 l0 85 28 -3 c21 -2 +32 -13 50 -48z m210 33 c-2 -12 -14 -19 -36 -21 -40 -4 -42 -22 -2 -22 23 0 +30 -4 30 -20 0 -16 -7 -20 -30 -20 -20 0 -30 -5 -30 -15 0 -10 11 -15 35 -15 +29 0 35 -4 35 -20 0 -19 -5 -21 -57 -18 l-58 3 -3 83 -4 82 62 0 c53 0 61 -2 +58 -17z m150 5 c15 -15 16 -50 2 -64 -7 -7 -6 -22 5 -47 19 -47 19 -47 -10 +-47 -20 0 -27 6 -31 30 -9 40 -34 40 -34 -1 0 -26 -3 -30 -22 -27 -21 3 -23 9 +-26 86 l-3 82 54 0 c29 0 58 -5 65 -12z"/> +</g> +</svg> diff --git a/addons/web/static/src/img/openerp_partner_ready.png b/addons/web/static/src/img/openerp_partner_ready.png Binary files differnew file mode 100644 index 00000000000..baaf8b9458b --- /dev/null +++ b/addons/web/static/src/img/openerp_partner_ready.png diff --git a/addons/web/static/src/img/openerp_partner_silver.png b/addons/web/static/src/img/openerp_partner_silver.png Binary files differnew file mode 100644 index 00000000000..6506c65ba10 --- /dev/null +++ b/addons/web/static/src/img/openerp_partner_silver.png diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 05ce709e80a..631a7f8c6f5 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -19,12 +19,14 @@ /** * OpenERP instance constructor * - * @param {Array} modules list of modules to initialize + * @param {Array|String} modules list of modules to initialize */ init: function(modules) { - // By default only web will be loaded, the rest will be by loaded - // by openerp.web.Session on the first session_authenticate - modules = _.union(['web'], modules || []); + if (modules === "fuck your shit, don't load anything you cunt") { + modules = []; + } else { + modules = _.union(['web'], modules || []); + } var new_instance = { // links to the global openerp _openerp: openerp, diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 4ab9d1fe195..0db21f2397f 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -422,7 +422,7 @@ instance.web.DatabaseManager = instance.web.Widget.extend({ self.db_list = null; }); var fetch_langs = this.rpc("/web/session/get_lang_list", {}).done(function(result) { - self.lang_list = result.lang_list; + self.lang_list = result; }); return $.when(fetch_db, fetch_langs).done(self.do_render); }, @@ -1052,7 +1052,7 @@ instance.web.UserMenu = instance.web.Widget.extend({ on_menu_settings: function() { var self = this; if (!this.getParent().has_uncommitted_changes()) { - self.rpc("/web/action/load", { action_id: "base.action_res_users_my" }, function(result) { + self.rpc("/web/action/load", { action_id: "base.action_res_users_my" }).done(function(result) { result.res_id = instance.session.uid; self.getParent().action_manager.do_action(result); }); @@ -1148,21 +1148,65 @@ instance.web.WebClient = instance.web.Client.extend({ }, start: function() { var self = this; + return $.when(this._super()).pipe(function() { self.$el.on('contextmenu','.oe_logo',function(e) { - instance.web.dialog($(QWeb.render('Resolution')),{ - title: "OpenERP Resolution" }); - + self.$el.find('.resolution').remove(); + self.$el.find('.oe_logo').after(QWeb.render('Resolution')) + self.$el.find('.oe_leftbar').css('display','inline-block'); $(self.$el).click(function(){ - $('.resolution').dialog('close'); - }) - $('.resolution a').click(function() { - self.$el.find('.oe_logo').css('width', $(this).attr('awidth')+"px"); - self.$el.find('.oe_logo').css('height', $(this).attr('aheight')+"px"); - self.$el.find('.oe_logo img').css('width', $(this).attr('imgw')+"px"); - self.$el.find('.oe_logo img').css('height', $(this).attr('imgh')+"px"); - }) - }) + self.$el.find('.resolution').hide(); + self.$el.find('.oe_leftbar').css('display','table-cell'); + }); + $('.resolution .res div[class]').each(function(){ + $(this).find('a').click(function(){ + if($(this).attr('id') == "freeto"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/logo.png') + } + if($(this).attr('id') == "readyto"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_ready.png') + } + if($(this).attr('id') == "silverto"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_silver.png') + } + if($(this).attr('id') == "goldto"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_gold.png') + } + if($(this).attr('id') == "community"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_community.png') + } + self.$el.find('.oe_logo').find('img').removeAttr("style"); + }); + $(this).find('div a').click(function(){ + if($(this).parent().attr('id') == "free"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/logo.png') + } + if($(this).parent().attr('id') == "ready"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_ready.png') + } + if($(this).parent().attr('id') == "silver"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_silver.png') + } + if($(this).parent().attr('id') == "gold"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_partner_gold.png') + } + if($(this).parent().attr('id') == "community"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/openerp_community.png') + } + if($(this).attr('id') == "vec"){ + self.$el.find('.oe_logo').find('img').attr('src','web/static/src/img/logo1.png') + } + if($(this).attr('id') == "low"){ + self.$el.find('.oe_logo').find('img').css('width','150px') + self.$el.find('.oe_logo').find('img').css('height','40px') + } + else if($(this).attr('id') == "high"){ + self.$el.find('.oe_logo').find('img').css('width','185px') + self.$el.find('.oe_logo').find('img').css('height','50px') + } + }); + }); + }); self.$el.on('click', '.oe_logo', function(e) { self.action_manager.do_action('home'); }); diff --git a/addons/web/static/src/js/corelib.js b/addons/web/static/src/js/corelib.js index 6ea0fd53372..06b3940f1e1 100644 --- a/addons/web/static/src/js/corelib.js +++ b/addons/web/static/src/js/corelib.js @@ -774,10 +774,10 @@ instance.web.Widget = instance.web.Class.extend(instance.web.PropertiesMixin, { } return false; }, - rpc: function(url, data, success, error) { - var def = $.Deferred().done(success).fail(error); + rpc: function(url, data, options) { + var def = $.Deferred(); var self = this; - instance.session.rpc(url, data).done(function() { + instance.session.rpc(url, data, options).done(function() { if (!self.isDestroyed()) def.resolve.apply(def, arguments); }).fail(function() { @@ -1231,12 +1231,14 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { * * @param {String} url RPC endpoint * @param {Object} params call parameters + * @param {Object} options additional options for rpc call * @param {Function} success_callback function to execute on RPC call success * @param {Function} error_callback function to execute on RPC call failure * @returns {jQuery.Deferred} jquery-provided ajax deferred */ - rpc: function(url, params) { + rpc: function(url, params, options) { var self = this; + options = options || {}; // url can be an $.ajax option object if (_.isString(url)) { url = { url: url }; @@ -1251,10 +1253,12 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { id: _.uniqueId('r') }; var deferred = $.Deferred(); - this.trigger('request', url, payload); + if (! options.shadow) + this.trigger('request', url, payload); var request = this.rpc_function(url, payload).done( function (response, textStatus, jqXHR) { - self.trigger('response', response); + if (! options.shadow) + self.trigger('response', response); if (!response.error) { if (url.url === '/web/session/eval_domain_and_context') { self.test_eval(params, response.result); @@ -1268,7 +1272,8 @@ instance.web.JsonRPC = instance.web.Class.extend(instance.web.PropertiesMixin, { } ).fail( function(jqXHR, textStatus, errorThrown) { - self.trigger('response_failed', jqXHR); + if (! options.shadow) + self.trigger('response_failed', jqXHR); var error = { code: -32098, message: "XmlHttpRequestError " + errorThrown, diff --git a/addons/web/static/src/js/coresetup.js b/addons/web/static/src/js/coresetup.js index 7789bb48785..7ddefa301f2 100644 --- a/addons/web/static/src/js/coresetup.js +++ b/addons/web/static/src/js/coresetup.js @@ -22,9 +22,9 @@ instance.web.Session = instance.web.JsonRPC.extend( /** @lends instance.web.Sess this.name = instance._session_id; this.qweb_mutex = new $.Mutex(); }, - rpc: function(url, params) { + rpc: function(url, params, options) { params.session_id = this.session_id; - return this._super(url, params); + return this._super(url, params, options); }, /** * Setup a sessionm diff --git a/addons/web/static/src/js/data.js b/addons/web/static/src/js/data.js index 9162d0066c2..524a88bdc48 100644 --- a/addons/web/static/src/js/data.js +++ b/addons/web/static/src/js/data.js @@ -278,9 +278,10 @@ instance.web.Model = instance.web.Class.extend({ * @param {String} method name of the method to call * @param {Array} [args] positional arguments * @param {Object} [kwargs] keyword arguments + * @param {Object} [options] additional options for the rpc() method * @returns {jQuery.Deferred<>} call result */ - call: function (method, args, kwargs) { + call: function (method, args, kwargs, options) { args = args || []; kwargs = kwargs || {}; if (!_.isArray(args)) { @@ -294,7 +295,7 @@ instance.web.Model = instance.web.Class.extend({ method: method, args: args, kwargs: kwargs - }); + }, options); }, /** * Fetches a Query instance bound to this model, for searching diff --git a/addons/web/static/src/js/testing.js b/addons/web/static/src/js/testing.js new file mode 100644 index 00000000000..bf39f543734 --- /dev/null +++ b/addons/web/static/src/js/testing.js @@ -0,0 +1,393 @@ +// Test support structures and methods for OpenERP +openerp.testing = {}; +(function (testing) { + var dependencies = { + corelib: [], + coresetup: ['corelib'], + data: ['corelib', 'coresetup'], + dates: [], + formats: ['coresetup', 'dates'], + chrome: ['corelib', 'coresetup'], + views: ['corelib', 'coresetup', 'data', 'chrome'], + search: ['data', 'coresetup', 'formats'], + list: ['views', 'data'], + form: ['data', 'views', 'list', 'formats'], + list_editable: ['list', 'form', 'data'], + }; + + testing.dependencies = window['oe_all_dependencies'] || []; + testing.current_module = null; + testing.templates = { }; + testing.add_template = function (name) { + var xhr = QWeb2.Engine.prototype.get_xhr(); + xhr.open('GET', name, false); + xhr.send(null); + (testing.templates[testing.current_module] = + testing.templates[testing.current_module] || []) + .push(xhr.responseXML); + }; + /** + * Function which does not do anything + */ + testing.noop = function () { }; + /** + * Alter provided instance's ``session`` attribute to make response + * mockable: + * + * * The ``responses`` parameter can be used to provide a map of (RPC) + * paths (e.g. ``/web/view/load``) to a function returning a response + * to the query. + * * ``instance.session`` grows a ``responses`` attribute which is + * a map of the same (and is in fact initialized to the ``responses`` + * parameter if one is provided) + * + * Note that RPC requests to un-mocked URLs will be rejected with an + * error message: only explicitly specified urls will get a response. + * + * Mocked sessions will *never* perform an actual RPC connection. + * + * @param instance openerp instance being initialized + * @param {Object} [responses] + */ + testing.mockifyRPC = function (instance, responses) { + var session = instance.session; + session.responses = responses || {}; + session.rpc_function = function (url, payload) { + var fn, params; + var needle = payload.params.model + ':' + payload.params.method; + if (url.url === '/web/dataset/call_kw' + && needle in this.responses) { + fn = this.responses[needle]; + params = [ + payload.params.args || [], + payload.params.kwargs || {} + ]; + } else { + fn = this.responses[url.url]; + params = [payload]; + } + + if (!fn) { + return $.Deferred().reject({}, 'failed', + _.str.sprintf("Url %s not found in mock responses, with arguments %s", + url.url, JSON.stringify(payload.params)) + ).promise(); + } + try { + return $.when(fn.apply(null, params)).then(function (result) { + // Wrap for RPC layer unwrapper thingy + return {result: result}; + }); + } catch (e) { + // not sure why this looks like that + return $.Deferred().reject({}, 'failed', String(e)); + } + }; + }; + + var StackProto = { + execute: function (fn) { + var args = [].slice.call(arguments, 1); + // Warning: here be dragons + var i = 0, setups = this.setups, teardowns = this.teardowns; + var d = $.Deferred(); + + var succeeded, failed; + var success = function () { + succeeded = _.toArray(arguments); + return teardown(); + }; + var failure = function () { + // save first failure + if (!failed) { + failed = _.toArray(arguments); + } + // chain onto next teardown + return teardown(); + }; + + var setup = function () { + // if setup to execute + if (i < setups.length) { + var f = setups[i] || testing.noop; + $.when(f.apply(null, args)).then(function () { + ++i; + setup(); + }, failure); + } else { + $.when(fn.apply(null, args)).then(success, failure); + } + }; + var teardown = function () { + // if teardown to execute + if (i > 0) { + var f = teardowns[--i] || testing.noop; + $.when(f.apply(null, args)).then(teardown, failure); + } else { + if (failed) { + d.reject.apply(d, failed); + } else if (succeeded) { + d.resolve.apply(d, succeeded); + } else { + throw new Error("Didn't succeed or fail?"); + } + } + }; + setup(); + + return d; + }, + push: function (setup, teardown) { + return _.extend(Object.create(StackProto), { + setups: this.setups.concat([setup]), + teardowns: this.teardowns.concat([teardown]) + }); + }, + unshift: function (setup, teardown) { + return _.extend(Object.create(StackProto), { + setups: [setup].concat(this.setups), + teardowns: [teardown].concat(this.teardowns) + }); + } + }; + /** + * + * @param {Function} [setup] + * @param {Function} [teardown] + * @return {*} + */ + testing.Stack = function (setup, teardown) { + return _.extend(Object.create(StackProto), { + setups: setup ? [setup] : [], + teardowns: teardown ? [teardown] : [] + }); + }; + + var db = window['oe_db_info']; + testing.section = function (name, options, body) { + if (_.isFunction(options)) { + body = options; + options = {}; + } + _.defaults(options, { + setup: testing.noop, + teardown: testing.noop + }); + + QUnit.module(testing.current_module + '.' + name, {_oe: options}); + body(testing.case); + }; + testing.case = function (name, options, callback) { + if (_.isFunction(options)) { + callback = options; + options = {}; + } + + var module = testing.current_module; + var module_index = _.indexOf(testing.dependencies, module); + var module_deps = testing.dependencies.slice( + // If module not in deps (because only tests, no JS) -> indexOf + // returns -1 -> index becomes 0 -> replace with ``undefined`` so + // Array#slice returns a full copy + 0, module_index + 1 || undefined); + + // Serialize options for this precise test case + // WARNING: typo is from jquery, do not fix! + var env = QUnit.config.currentModuleTestEnviroment; + // section setup + // case setup + // test + // case teardown + // section teardown + var case_stack = testing.Stack() + .push(env._oe.setup, env._oe.teardown) + .push(options.setup, options.teardown); + var opts = _.defaults({}, options, env._oe); + // FIXME: if this test is ignored, will still query + if (opts.rpc === 'rpc' && !db) { + QUnit.config.autostart = false; + db = { + source: null, + supadmin: null, + password: null + }; + var $msg = $('<form style="margin: 0 1em 1em;">') + .append('<h3>A test needs to clone a database</h3>') + .append('<h4>Please provide the source clone information</h4>') + .append(' Source DB: ').append('<input name="source">').append('<br>') + .append(' DB Password: ').append('<input name="supadmin">').append('<br>') + .append('Admin Password: ').append('<input name="password">').append('<br>') + .append('<input type="submit" value="OK"/>') + .submit(function (e) { + e.preventDefault(); + e.stopPropagation(); + db.source = $msg.find('input[name=source]').val(); + db.supadmin = $msg.find('input[name=supadmin]').val(); + db.password = $msg.find('input[name=password]').val(); + QUnit.start(); + $.unblockUI(); + }); + $.blockUI({ + message: $msg, + css: { + fontFamily: 'monospace', + textAlign: 'left', + whiteSpace: 'pre-wrap', + cursor: 'default' + } + }); + } + + QUnit.test(name, function () { + var instance; + if (!opts.dependencies) { + instance = openerp.init(module_deps); + } else { + // empty-but-specified dependencies actually allow running + // without loading any module into the instance + + // TODO: clean up this mess + var d = opts.dependencies.slice(); + // dependencies list should be in deps order, reverse to make + // loading order from last + d.reverse(); + var di = 0; + while (di < d.length) { + var m = /^web\.(\w+)$/.exec(d[di]); + if (m) { + d[di] = m[1]; + } + d.splice.apply(d, [di+1, 0].concat( + _(dependencies[d[di]]).reverse())); + ++di; + } + + instance = openerp.init("fuck your shit, don't load anything you cunt"); + _(d).chain() + .reverse() + .uniq() + .each(function (module) { + openerp.web[module](instance); + }); + } + if (_.isNumber(opts.asserts)) { + expect(opts.asserts); + } + + if (opts.templates) { + for(var i=0; i<module_deps.length; ++i) { + var dep = module_deps[i]; + var templates = testing.templates[dep]; + if (_.isEmpty(templates)) { continue; } + + for (var j=0; j < templates.length; ++j) { + instance.web.qweb.add_template(templates[j]); + } + } + } + + var $fixture = $('#qunit-fixture'); + + var mock, async = false; + switch (opts.rpc) { + case 'mock': + async = true; + testing.mockifyRPC(instance); + mock = function (spec, handler) { + instance.session.responses[spec] = handler; + }; + break; + case 'rpc': + async = true; + (function () { + // Bunch of random base36 characters + var dbname = 'test_' + Math.random().toString(36).slice(2); + // Add db setup/teardown at the start of the stack + case_stack = case_stack.unshift(function (instance) { + // FIXME hack: don't want the session to go through shitty loading process of everything + instance.session.session_init = testing.noop; + instance.session.load_modules = testing.noop; + instance.session.session_bind(); + return instance.session.rpc('/web/database/duplicate', { + fields: [ + {name: 'super_admin_pwd', value: db.supadmin}, + {name: 'db_original_name', value: db.source}, + {name: 'db_name', value: dbname} + ] + }).then(function (result) { + if (result.error) { + return $.Deferred().reject(result.error).promise(); + } + return instance.session.session_authenticate( + dbname, 'admin', db.password, true); + }); + }, function (instance) { + return instance.session.rpc('/web/database/drop', { + fields: [ + {name: 'drop_pwd', value: db.supadmin}, + {name: 'drop_db', value: dbname} + ] + }).then(function (result) { + if (result.error) { + return $.Deferred().reject(result.error).promise(); + } + return result; + }); + }); + })(); + } + + // Always execute tests asynchronously + stop(); + var timeout; + case_stack.execute(function () { + var result = callback.apply(null, arguments); + if (!(result && _.isFunction(result.then))) { + if (async) { + ok(false, "asynchronous test cases must return a promise"); + } + } else { + if (!_.isNumber(opts.asserts)) { + ok(false, "asynchronous test cases must specify the " + + "number of assertions they expect"); + } + } + + return $.Deferred(function (d) { + $.when(result).then(function () { + d.resolve.apply(d, arguments) + }, function () { + d.reject.apply(d, arguments); + }); + if (async || (result && result.then)) { + // async test can be either implicit async (rpc) or + // promise-returning + timeout = setTimeout(function () { + QUnit.config.semaphore = 1; + d.reject({message: "Test timed out"}); + }, 2000); + } + }); + }, instance, $fixture, mock).always(function () { + if (timeout) { clearTimeout(timeout); } + start(); + }).fail(function (error) { + if (options.fail_on_rejection === false) { + return; + } + var message; + if (typeof error !== 'object' + || typeof error.message !== 'string') { + message = JSON.stringify([].slice.apply(arguments)); + } else { + message = error.message; + if (error.data && error.data.debug) { + message += '\n\n' + error.data.debug; + } + } + + ok(false, message); + }); + }); + }; +})(openerp.testing); diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index a563f496af2..fc3370bd083 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -660,6 +660,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM return self._process_save(save_obj).then(function() { save_obj.ret = _.toArray(arguments); return iterate(); + + }, function() { + save_obj.error = true; }); } return $.when(); @@ -843,6 +846,8 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var save_obj = {prepend_on_create: prepend_on_create, ret: null}; this.save_list.push(save_obj); return this._process_operations().then(function() { + if (save_obj.error) + return $.Deferred().reject(); return $.when.apply($, save_obj.ret); }); }, @@ -3871,26 +3876,13 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({ this._super.apply(this, arguments); }, do_delete: function (ids) { - var self = this; - var next = $.when(); - var _super = this._super; - // handle deletion of an item which does not exist - // TODO: better handle that in the editable list? - var false_id_index = _(ids).indexOf(false); - if (false_id_index !== -1) { - ids.splice(false_id_index, 1); - next = this.cancel_edition(true); - } - return next.then(function () { - // wheeee - var confirm = window.confirm; - window.confirm = function () { return true; }; - try { - return _super.call(self, ids); - } finally { - window.confirm = confirm; - } - }); + var confirm = window.confirm; + window.confirm = function () { return true; }; + try { + return this._super(ids); + } finally { + window.confirm = confirm; + } } }); instance.web.form.One2ManyGroups = instance.web.ListView.Groups.extend({ @@ -5038,14 +5030,14 @@ instance.web.form.FieldBinaryImage = instance.web.form.FieldBinary.extend({ * Options on attribute ; "blockui" {Boolean} block the UI or not * during the file is uploading */ -instance.web.form.FieldOne2ManyBinaryMultiFiles = instance.web.form.AbstractField.extend({ +instance.web.form.FieldMany2ManyBinaryMultiFiles = instance.web.form.AbstractField.extend({ template: "FieldBinaryFileUploader", init: function(field_manager, node) { this._super(field_manager, node); this.field_manager = field_manager; this.node = node; - if(this.field.type != "one2many" || this.field.relation != 'ir.attachment') { - throw "The type of the field '"+this.field.string+"' must be a one2many field with a relation to 'ir.attachment' model."; + if(this.field.type != "many2many" || this.field.relation != 'ir.attachment') { + throw "The type of the field '"+this.field.string+"' must be a many2many field with a relation to 'ir.attachment' model."; } this.ds_file = new instance.web.DataSetSearch(this, 'ir.attachment'); this.fileupload_id = _.uniqueId('oe_fileupload_temp'); @@ -5375,7 +5367,7 @@ instance.web.form.widgets = new instance.web.Registry({ 'progressbar': 'instance.web.form.FieldProgressBar', 'image': 'instance.web.form.FieldBinaryImage', 'binary': 'instance.web.form.FieldBinaryFile', - 'one2many_binary': 'instance.web.form.FieldOne2ManyBinaryMultiFiles', + 'many2many_binary': 'instance.web.form.FieldMany2ManyBinaryMultiFiles', 'statusbar': 'instance.web.form.FieldStatus', 'monetary': 'instance.web.form.FieldMonetary', }); diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index db8c962efc7..df74674a343 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -1,6 +1,6 @@ openerp.web.list = function (instance) { var _t = instance.web._t, - _lt = instance.web._lt; + _lt = instance.web._lt; var QWeb = instance.web.qweb; instance.web.views.add('list', 'instance.web.ListView'); instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListView# */ { diff --git a/addons/web/static/src/js/view_list_editable.js b/addons/web/static/src/js/view_list_editable.js index 8bcf8b5d036..1abe3caab39 100644 --- a/addons/web/static/src/js/view_list_editable.js +++ b/addons/web/static/src/js/view_list_editable.js @@ -77,6 +77,15 @@ openerp.web.list_editable = function (instance) { do_edit: function (index, id, dataset) { _.extend(this.dataset, dataset); }, + do_delete: function (ids) { + var _super = this._super.bind(this); + var next = this.editor.is_editing() + ? this.cancel_edition(true) + : $.when(); + return next.then(function () { + return _super(ids); + }); + }, editable: function () { return this.fields_view.arch.attrs.editable || this._context_editable diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index d804bd57cf8..641821152b2 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -25,7 +25,6 @@ instance.web.ActionManager = instance.web.Widget.extend({ dialog_stop: function () { if (this.dialog) { this.dialog.destroy(); - this.dialog = null; } }, /** @@ -790,8 +789,8 @@ instance.web.ViewManagerAction = instance.web.ViewManager.extend({ name: "JS Tests", target: 'new', type : 'ir.actions.act_url', - url: '/web/static/test/test.html' - }) + url: '/web/tests?mod=*' + }); break; case 'perm_read': var ids = current_view.get_selected_ids(); diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index 1c29d3181ef..17d2f06742e 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -12,23 +12,39 @@ </t> <t t-name="Resolution"> <div class="resolution"> - <table> - <tr> - <td colspan="2"><label>Resolution:</label></td> - </tr> - <tr> - <td><a awidth="150" aheight="60" imgw="100" imgh="30">150 x 60</a></td> - <td><a awidth="250" aheight="90" imgw="200" imgh="60">250 x 90</a></td> - </tr> - <tr> - <td><a awidth="290" aheight="90" imgw="225" imgh="60">290 x 90</a></td> - <td><a awidth="320" aheight="100" imgw="257" imgh="70">320 x 100</a></td> - </tr> - <tr> - <td></td> - <td style="float:right;"><a awidth="220" aheight="70" imgw="157" imgh="40">Original</a></td> - </tr> - </table> + <div class="res"> + <div class="simtext"> + Looking for the OpenERP logo? <br></br> + <span>Thank you for using and promoting the OpenERP brand.Select<br></br> + the logo that fits your need. + </span> + </div> + <div class="freeto"> + <a id="freeto"><img alt="Test" src="/web/static/src/img/logo.png" width="45px" height="170px"></img></a> + <div><span>Free to Use</span><br/> + <span id="free"><a id="low" href="#">Low Res |</a><a id="high" href="#">High Res |</a><a id="vec" href="#">Vectorial</a></span></div> + </div> + <div class="readyto"> + <a id="readyto"><img alt="Test" src="/web/static/src/img/openerp_partner_ready.png"></img></a> + <div><span>Official Ready Partners Only</span><br/> + <span id="ready"><a id="low" href="#">Low Res |</a><a id="high" href="#">High Res</a></span></div> + </div> + <div class="silverto"> + <a id="silverto"><img alt="Test" src="/web/static/src/img/openerp_partner_silver.png"></img></a> + <div><span>Official Silver Partners Only</span><br/> + <span id="silver"><a id="low" href="#">Low Res |</a><a id="high" href="#">High Res</a></span></div> + </div> + <div class="goldto"> + <a id="goldto"><img alt="Test" src="/web/static/src/img/openerp_partner_gold.png"></img></a> + <div><span>Official Golden Partners Only</span><br/> + <span id="gold"><a id="low" href="#">Low Res |</a><a id="high" href="#">High Res</a></span></div> + </div> + <div class="community" style="border-bottom: 0px;"> + <a id="community"><img alt="Test" src="/web/static/src/img/openerp_community.png"></img></a> + <div><span>Community Members Only</span><br/> + <span id="community"><a id="low" href="#">Low Res |</a><a id="high" href="#">High Res</a></span></div> + </div> + </div> </div> </t> <t t-name="Notification"> @@ -406,7 +422,7 @@ <t t-esc="menu.name"/> <t t-if="menu.needaction_enabled and menu.needaction_counter"> <div class="oe_tag oe_tag_dark oe_menu_counter"> - <t t-esc="menu.needaction_counter"/> + <t t-if="menu.needaction_counter > 99"> ∞ </t><t t-if="menu.needaction_counter lt= 99"> <t t-esc="menu.needaction_counter"/> </t> </div> </t> </a> |
