From b8131e668d1e765cd13859404dc813000ec45114 Mon Sep 17 00:00:00 2001 From: Jordi Riera Date: Fri, 23 Jan 2015 14:25:10 -0500 Subject: [PATCH 01/19] [IMP] rename website_menu_display to website_menu_by_user_statuts --- website_menu_by_user_status/README.rst | 28 +++++++++++ website_menu_by_user_status/__init__.py | 22 +++++++++ website_menu_by_user_status/__openerp__.py | 44 +++++++++++++++++ .../i18n/website_menu_by_user_status.po | 34 +++++++++++++ .../models/__init__.py | 22 +++++++++ .../models/website_menu.py | 45 ++++++++++++++++++ .../static/description/icon.png | Bin 0 -> 7439 bytes .../views/website_templates.xml | 15 ++++++ .../views/website_views.xml | 16 +++++++ 9 files changed, 226 insertions(+) create mode 100644 website_menu_by_user_status/README.rst create mode 100644 website_menu_by_user_status/__init__.py create mode 100644 website_menu_by_user_status/__openerp__.py create mode 100644 website_menu_by_user_status/i18n/website_menu_by_user_status.po create mode 100644 website_menu_by_user_status/models/__init__.py create mode 100644 website_menu_by_user_status/models/website_menu.py create mode 100644 website_menu_by_user_status/static/description/icon.png create mode 100644 website_menu_by_user_status/views/website_templates.xml create mode 100644 website_menu_by_user_status/views/website_views.xml diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst new file mode 100644 index 0000000000..3a862f6812 --- /dev/null +++ b/website_menu_by_user_status/README.rst @@ -0,0 +1,28 @@ +Website Menu By User Status +=========================== + +The module manages display website menu entries, depending if the user is +logged or not. +The selection of the display status can be chosen logged and/or not. +Extends features and view of website.menu model. + +Website.menu list view can be found at: +Settings > Configuration > Website Settings > Configure Website menus + +The module inherit from website.menu to add 2 booleans fields, user_logged +and user_not_logged. +On top of that, website.layout template is extended to include a condition +that drive if the menu is built or not. +It has been choose to not only hide the menu to avoid to easily get around +by editing the html DOM. + +Contributors +------------ +* Bruno Joliveau +* Jordi Riera + +More information +---------------- +Module developed and tested with Odoo version 8.0 +For questions, please contact our support services + diff --git a/website_menu_by_user_status/__init__.py b/website_menu_by_user_status/__init__.py new file mode 100644 index 0000000000..f91123356f --- /dev/null +++ b/website_menu_by_user_status/__init__.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2010 - 2014 Savoir-faire Linux +# (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import models diff --git a/website_menu_by_user_status/__openerp__.py b/website_menu_by_user_status/__openerp__.py new file mode 100644 index 0000000000..38dc784973 --- /dev/null +++ b/website_menu_by_user_status/__openerp__.py @@ -0,0 +1,44 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'Website Menu By User Display', + 'version': '8.0.1.1.0', + 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', + 'website': 'http://www.savoirfairelinux.com', + 'license': 'AGPL-3', + 'category': 'Website', + 'summary': 'Allow to manage the display of website.menus', + 'depends': [ + 'website', + ], + 'external_dependencies': { + 'python': [], + }, + 'data': [ + 'views/website_templates.xml', + 'views/website_views.xml', + ], + 'demo': [], + 'test': [], + 'installable': True, +} diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.po b/website_menu_by_user_status/i18n/website_menu_by_user_status.po new file mode 100644 index 0000000000..6dfd523128 --- /dev/null +++ b/website_menu_by_user_status/i18n/website_menu_by_user_status.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-02-02 14:37+0000\n" +"PO-Revision-Date: 2015-02-02 14:37+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: website_menu_by_user_status +#: code:addons/website_menu_by_user_status/models/website_menu.py:36 +#, python-format +msgid "If checked, the menu will be displayed when the user is logged." +msgstr "" + +#. module: website_menu_by_user_status +#: code:addons/website_menu_by_user_status/models/website_menu.py:43 +#, python-format +msgid "If checked, the menu will be displayed when the user is not logged." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "" + diff --git a/website_menu_by_user_status/models/__init__.py b/website_menu_by_user_status/models/__init__.py new file mode 100644 index 0000000000..a8462e5b88 --- /dev/null +++ b/website_menu_by_user_status/models/__init__.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2010 - 2014 Savoir-faire Linux +# (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import website_menu diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py new file mode 100644 index 0000000000..255ee69649 --- /dev/null +++ b/website_menu_by_user_status/models/website_menu.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +# +# OpenERP, Open Source Management Solution +# This module copyright (C) 2013 Savoir-faire Linux +# (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# + +import logging +_logger = logging.getLogger(__name__) +from openerp import models, fields +from openerp.tools.translate import _ + + +class WebsiteMenu(models.Model): + """Improve website.menu with adding booleans that drive + if the menu is displayed when the user is logger or not. + """ + _inherit = 'website.menu' + + user_logged = fields.Boolean( + string="User Logged", + default=True, + help=_("If checked, " + "the menu will be displayed when the user is logged.") + ) + + user_not_logged = fields.Boolean( + string="User Not Logged", + default=True, + help=_("If checked, " + "the menu will be displayed when the user is not logged.") + ) diff --git a/website_menu_by_user_status/static/description/icon.png b/website_menu_by_user_status/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d7b9f4f25bd009970ad1f6bb2823c1b8593ad2bd GIT binary patch literal 7439 zcmV+q9q{6bP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*z; z7Ah(W-SC?L0344=L_t(|+SPn%kX*-oUtjNjZ{FOqJ2QI&SS%ILB03HBIV6peT zGqZCa@9yq=c*J0^z~UlEiTz<}rsutx{`LPp`a#ARgb)A#0N|W+&b#lyyLNOD0RRv} zT|^K`5a08_`G~<7yZPpuKl9noVvH3< zk!6_>(j_$sX~-A@)SEXBmRLufdGz1@(PwPO>F&zh+}wi?J{Su9*@!rj4fEjd0DM|B z!dt>uEHsZiL>ub|-}~M#eBlee?|=ErU%vnT``hjITO{N1^77o=+%31h0!96*8_g#0EYYjpOgpg7?G&JoG|fVx(BI$hIL_MIS~i}-d3pKu*I(zH6GB3+?ot?qgkp@@j=Li%0v1p|SXf+q;)y4o zefHU-M~^=9%rh9{Z8w}V4CpmEEy|i-~ayi*Vfjae){QCr%rjEcj(X| z%d%EiSHJ%CuP-kz+qQl5=+TXh4MNDHk3RbJ(@(crt#5z(+oe+J(4j-mKKpF5*?jD= z#}*bA%H?vS(XegX_x(@-zbT$w3&bd`S`1=>2+8Mi&9==L6$C+1lvb;C0S;pjuQ#b8 zz`D!ZC0E2y6>-pJ6sqtvBWaozZg3IyxGU$34%x^UgaR$1x1!o_p?z$K#aJJ$v>{O-(tDbI(2ZNRosQ`ot$bVVdT| z!~{YJLO41)TB%fOwOT5b@;t9=bV9BsJw_QVPQ7YbZ2Hu5C#J4%w%(MqMx!x1JKO7@ zoB@j6YKr}r){jG0(i!oLx6dris0oQe3c;SU!!8?5T zFhVHY_i+BaVtMS?vC!m{N~Kb%w6?a^l}yfg_ZJXC&1N$Q0@rmz@^(E7000bvfKuwZ zE~WIATW&5DOAtZE_;%L(Tvf~g2Y{beRcC8yh`?z>&|TTvZJZcmJ9qB<=tn;~I5;>u zI-1R9VxkfAYzv5W)cPu9?1c-MO8JZ*lbAx?6GXs(SYkLWnUweE9I= zk3Zf^lxFg+^{X9S)&&3%LOAD?(k=rs##*gb5Cq!=1*G?f z=4a>3cwCi)N~I=BV(2qq2(cgpp07s?LpKnD?>tD(ImWnJEjOE%s;ROh=tcx1_|nlM ziW-q*DPm{<0Nb+sAUO8wtJPW+W89Ua^8*F|Fz#0?<*AJ#Q8lMsvpZHS-B&Ab29)=u z)3PE>?%fLj+Ma>mUcz=-tvTG<=OctT2k;%o3nBD1aP>Egpe&7FPFf#%?T_3FynzHY6trcUNK=v?^*-|9)6{K%ZL#$PB60EpwE;7 z+bvfsfWu5Wb@ch?ckSEH17DWqa@$D1F+1Csg#a?n28@BL12|kwOoWM?vFG%%1I7UmLyfzxRO9BQKQJOBFAU%UTrzxero_tVFIYNpcZM6}&*kB#k^nwr|q zy+K>{6LdrW%gzD3UBmbNwY9ZZkH4{h@1A4FkNxy#zdZWVtLbzaBJ}Wg9vB@S`oSZQ zShkby%YOHPhqE#5;UE6QY1QC1YW(b38t~c%pnkXJ1b+>P3<1Q5j7Vamuy&fLju%&qaYJ z2cemU7gIC6!BaOYbanSAOd(sAg%Hv-ZDW0%1E|O%<51I7EC}VohN2sR?=!|2y}ww*AZLz0|&1q=pc>j&tPbVb=}%vjc`E8K$`~JAK`O8?H>P z_W05W*`*R}*E?3j>vVKgGgDcqR^rVv9GZk$6u>auai;!8DFqz3o z*1!6L`+oC_EvrTxIU0?H!IK~ey`;WkK8NR()vJ&I-~d7tcvRql7r@2M=1@|}#3jb* z%4RvYv8FA|{Fm>4u_^q#T|*o(DTT*&4+Fm3UU44$&R;gG_22)OUjoQmSy|5K2N+|X z=k;Q~LbMRJ?BGBDc;*+U>WYBQTiOs2`121Af8^TCol8_ zfA(L;{_+Qu)>r1{#o`JG<^pbJ(os;;+jC;OQOHGMB1v}c(`Qz``L(Zq90ZMI$}Crk zVX-PKXLZf>mHBNxV@)TB$XLKo7LX=kfgk~+m?j_y6#+2->Q-N? za~s?ZI=og~Y*wc?NV1uf6K;7Sx&Olf59e4@+v zuRl3?wGt_3IUem+$L`cswIP5dh!7AZPCcR+p6{2}*Nj+Z_xnCrpE_2MI5778#_e~R z$qA?!46*|sNaIZQ!EgM-CvTf9%}!_c=!l4{-ter=`BTTq!c=nahtngIZL19+5CjP! zNGa{o`2v_Pt2BQpT+>@0hP7IQ_+G7Cqpm|)z%V8liJ}NFvYSoTt_|(lb+X;=%kMT6 zY5A2Gq~kBgM@P~JZVDK_cE`|;Fa4?Oba<;&UtN^VI1zEHTzT!;SIo@Zt4}{YareKu z{;uD$ZOaLKOe9GXL!TU-&fssi(95-F7p@2N1`oJWT*Y<^1itIo-189Q9C9;}Ac~aK zWIbj6FACd=4VR&!iJjYlTG!FZ~yPsYeySz zyx`f*{de8Fpp1R*@t0nD>N&uIfU=c}(?XF}r?WbH;!u2gn4lHcjO!Z2Eu|KKw$;c zEm}|z&!0~C%2&P;s!hkXn^aJDz9%*^Zh2Hy4Psfy_o(ekoFq(xF<+6@k=yQe+O5Lj z7m~jC?8*7*>60Tv!;^O$^xbAW9@FyUfb&dL&Kt7d*esWeug(`>BXmBS@j-P1&AkKyk5vn-V?j-# zl?@z8(q;)Fg_oDsd@|=r>0}}vj~j-eC`#znLkQ0RwrpF&(A4#KGMP*y{Z31a4WuOA zmoU=VEMRPHd39-Oejt;Ljg5D_PIYsAcQ*TKsWdZnGGWRJWM+Ioz?@Ovt`?nEVQOyn zpN>p#dICnmKwMBK<>nBC8n?I;K(@Jb%4${>)l8)Fw%u;GJCY=axe3& z^<)McQK!*JME46TM+(y~t;{ZT8trPm{^M`_{jDoYsmbwRXT}el-`#opTBUYk<<#iJ zy}o>-_S82l#DD(WOQ#ms0?(!%xo$A#3rI@~i>-DVz(gd*eZT|2byBov`K#XM+U(eM z_xMh=R4VrM^>^)1Sf&fxpCw6z5L%WUPbN6$Oc?~3Jj6oa*#Socf@Y_KAu^+8tJP@Q zuINYk)Q>J&F69 zxvtf5n8@6nXg#QI%-gR$-%ub;sVCE>B1LqBV8oPCDOJQQH^QT-_=eJPAxvTtlz8d2 zR;DikV*tu9K(ympl8guA`v$T*0~VZdLKrI*H&f}9qF{{i$mnQyoqHll002*)QEdI` z6aWB#WcV>2ixmp%=cUpo?Kleyi}2z&SUJNFrfR zO`V#U*ewc#aSi|&8690+;58mKuf1b)>6@OmLF9}pVW?GO9x7X1Rm9Ob!-v3+vTw@aQ#_;Wl2hBGQRIGE-sDj7=r+E05Qgy{J>_ZSWriH{PWN5 zYHSiCYJ1hCxg+b-Ck|YbpF1^|-!)`r^DEXVM1W*TmM%t;MqD8#p)IG49Ifg5jPQVB zt4b(!`tvt_@Q%-oja|oh5H{{22pItLa|;`V^;j&P%l3ytc-4zrXLkS)tRf|o$t*9g zlsC(%bShLJvaFb93=2yC8J$#@<*9;PK{X4+ps3Ra-VRMKRf zv}S4|(iOE~QyGemgP zZ@l*U#O@s=H*TGH!6vOYcxk_=EJrsSP_$QT>#MHs26hKDH>eZ1oD&guD&@MSNe}@Q z?D>zM{T2Ywah-0@CS$Bxth0VAt#3Qr`-% zh6sh#pGzu;hxbd8lt`r7ZEJ3Be)sNO;iT)jd-hH)F3b<*bDczAn6C?+kmef*|PY&u&(#@$|?&zjyz`58XFcUmlKL)4>~2 zQ%0P<@{7Xt?@#AiEiL=Lw|DOz zP1hw+6h*NcIc$j^RLzK(F#v$)xq={_Zc*TjbBquG!1q1Rr>Y`{ca=-Ui`(HXF}Em+ zjIrU7p~c0em6g?jfjp%&)E}A=sWs|RGkWW7Uw-J}Pq!A284ZzWUQ}V_fct?jDRMN4 zZHwM}+yA`d`cKBA$q;R~S7>d0V{vII7L5)K4JfiAZjTlKK!c#LzHWOS5d=jNJq7>^ zAfu{g_%skjg>%LkHH^q*mRioo*g-(E{rzj}>k%^&F^q8AL{SW6rP*#q;zM_S_%EJ( z?T?5YYZQG%gh-xmtb1B?g*)jl-S>m>;r$RHKk#~e##5(e3dO?E;9xu+69iF~rLb3O zyF?GdIG#v&K@i5TBEpqwIc`SU?Y3@2BvJ5Phr&xe;72Zy5Q7jZip-c1F^sv{`8|6k zL{SKN+b|+)>uU(Xf!s~E3jgiprLPhl5ex@o;_QkKGVlA!@Bf3YM}olTJ*?%r-pQ#` zw$&crwM)}AQ4l0a5(E-zqiqv$oO1wl!@#Fwsdy~P7>g$$0Kl>=GZyR3ja?yy->lpb zq9|%#U!P?yEG;jOj*NuoN`fF58XTILnK2B1FmYG8zVX8H{Sl1|Aos@~`_#ui@Ln$q6Y%oY-u}HJt;EX1cscN+h z1qDGaB2X&Ve5WHxa(^}}io%ru?qx7RAc~^o^SQbCg+ie?IFR#$007`P&dA8f+S;l^ z9V2#MKKc4spYWdX&+Qm_kK@>H9^2v^Aru63d3mK!EcRtm$z)0tMU0W6C>PDqc3Ct2lG)gDu{wCy(zT4 zJ^UBgcZ_i&nLItAL`)L^ps8~B*)TK!fUfIXgmKI9@QVZ9vLIQOqo$c3$j{HsYpSBE zYWLh*CYeYCzCii`1i|T+CjbCOsNQTHe(`WN+m}vfRaFxN60-5-=3FmO``+?x7vvT@ z+`Z;ZoqoIi|L(~?Ns^;c)AQV^spqG&BnyHd zD{`;xx#FDbxd_keN_5XZ^j<^GljGdxFC|F?Kuf37wr$T$&yMfj1t35GoxA0ZM0opp*#tq5Wm%G>t>@vxoL2Zw5QIjf;kvG6S>bu*APBY` zzYD?GwpFQAS5}w1lGCf?D5V>PqGfebsnpDji!sI+3j%ouj(3H8DhNWMP>981s;Y{j z7%t#ULOU$yd7fukR<&9!7K_DVu~aJ6>-Fwwyg1y`c9A8ShM!Zg}oWmgQJ1 z*4NjUPN&o9bTk^(bv^Xt&SWjajnOnMkw{>SHBIYuI-ci++W1}Zpoce~X+Ve|2&$?^ zB9V~Dk|g!2Nzy&v6dnc-?+K4-Z#hi + + + + + diff --git a/website_menu_by_user_status/views/website_views.xml b/website_menu_by_user_status/views/website_views.xml new file mode 100644 index 0000000000..32c67e051e --- /dev/null +++ b/website_menu_by_user_status/views/website_views.xml @@ -0,0 +1,16 @@ + + + + + Website.menu: Display to user booleans + website.menu + + + + + + + + + + From 85f20bb6c1ece3d97642db642dd2bf7862b86b53 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 5 Oct 2015 07:12:20 -0400 Subject: [PATCH 02/19] OCA Transbot updated translations from Transifex --- ...ite_menu_by_user_status.po => website_menu_by_user_status.pot} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename website_menu_by_user_status/i18n/{website_menu_by_user_status.po => website_menu_by_user_status.pot} (100%) diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.po b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot similarity index 100% rename from website_menu_by_user_status/i18n/website_menu_by_user_status.po rename to website_menu_by_user_status/i18n/website_menu_by_user_status.pot From 1e29c0dc45bd3fada662d3f38065e2c3d9ddad9b Mon Sep 17 00:00:00 2001 From: gilles Date: Wed, 8 Mar 2017 15:59:41 +0100 Subject: [PATCH 03/19] [MIG] website_menu_by_user_status form v8 to v10 --- website_menu_by_user_status/README.rst | 58 ++++++++- website_menu_by_user_status/__init__.py | 26 +--- website_menu_by_user_status/__manifest__.py | 20 +++ website_menu_by_user_status/__openerp__.py | 44 ------- .../controllers/__init__.py | 1 + .../controllers/main.py | 122 ++++++++++++++++++ .../models/__init__.py | 25 +--- .../models/website_menu.py | 33 ++--- .../views/website_templates.xml | 37 +++++- .../views/website_views.xml | 6 +- 10 files changed, 253 insertions(+), 119 deletions(-) create mode 100644 website_menu_by_user_status/__manifest__.py delete mode 100644 website_menu_by_user_status/__openerp__.py create mode 100644 website_menu_by_user_status/controllers/__init__.py create mode 100644 website_menu_by_user_status/controllers/main.py diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index 3a862f6812..af4963b10c 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -1,3 +1,8 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=========================== Website Menu By User Status =========================== @@ -5,9 +10,26 @@ The module manages display website menu entries, depending if the user is logged or not. The selection of the display status can be chosen logged and/or not. Extends features and view of website.menu model. +But for modules that install new routes like _your_wesite_/shop or _your_wesite_/event +the redirection will not work in such cases. + +Installation +============ + +To install this module, just click to install butto + +Configuration +============= -Website.menu list view can be found at: -Settings > Configuration > Website Settings > Configure Website menus +#. you must activate the developer mode + +Usage +===== + +To use this module, you need to edit website menu pages list view that can be found at : +Website Admin > Configuration > Settings > Configure website menus + +#. remove default filter to edit website menu line The module inherit from website.menu to add 2 booleans fields, user_logged and user_not_logged. @@ -16,13 +38,43 @@ that drive if the menu is built or not. It has been choose to not only hide the menu to avoid to easily get around by editing the html DOM. +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Images +------ + +* Odoo Community Association: `Icon `_. + + Contributors ------------ * Bruno Joliveau * Jordi Riera +* Meyomesse Gilles More information ---------------- -Module developed and tested with Odoo version 8.0 +Module developed and tested with Odoo version 10.0 For questions, please contact our support services + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/website_menu_by_user_status/__init__.py b/website_menu_by_user_status/__init__.py index f91123356f..3b2f171ce3 100644 --- a/website_menu_by_user_status/__init__.py +++ b/website_menu_by_user_status/__init__.py @@ -1,22 +1,6 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import models +from . import controllers + diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py new file mode 100644 index 0000000000..fed4a6c578 --- /dev/null +++ b/website_menu_by_user_status/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2013-2017 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + 'name': 'Website Menu By User Display', + 'version': '10.0.1.0.0', + 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', + 'website': 'http://www.savoirfairelinux.com', + 'license': 'AGPL-3', + 'category': 'Website', + 'summary': 'Allow to manage the display of website.menus', + 'depends': [ + 'website', + ], + 'data': [ + 'views/website_templates.xml', + 'views/website_views.xml', + ], + 'installable': True, +} diff --git a/website_menu_by_user_status/__openerp__.py b/website_menu_by_user_status/__openerp__.py deleted file mode 100644 index 38dc784973..0000000000 --- a/website_menu_by_user_status/__openerp__.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Savoir-faire Linux -# (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'Website Menu By User Display', - 'version': '8.0.1.1.0', - 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', - 'website': 'http://www.savoirfairelinux.com', - 'license': 'AGPL-3', - 'category': 'Website', - 'summary': 'Allow to manage the display of website.menus', - 'depends': [ - 'website', - ], - 'external_dependencies': { - 'python': [], - }, - 'data': [ - 'views/website_templates.xml', - 'views/website_views.xml', - ], - 'demo': [], - 'test': [], - 'installable': True, -} diff --git a/website_menu_by_user_status/controllers/__init__.py b/website_menu_by_user_status/controllers/__init__.py new file mode 100644 index 0000000000..12a7e529b6 --- /dev/null +++ b/website_menu_by_user_status/controllers/__init__.py @@ -0,0 +1 @@ +from . import main diff --git a/website_menu_by_user_status/controllers/main.py b/website_menu_by_user_status/controllers/main.py new file mode 100644 index 0000000000..dd0d7b02fa --- /dev/null +++ b/website_menu_by_user_status/controllers/main.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import logging + +from odoo import http +from odoo.http import request + +from odoo.addons.web.controllers.main import Home +from odoo import api + +logger = logging.getLogger(__name__) + + +class Website(Home): + + @api.model + def _get_pages(self): + """ + All pages width url + """ + return request.env['website.menu'].search([]).filtered('url') + + @api.multi + def _check_user_access(self): + """ + Is user logged + """ + return request.env.user == request.website.user_id or False + + @api.multi + def _get_suggest_page(self): + """ + All pages accessible by the user (logged or not) + """ + if self._check_user_access(): + return self._get_pages().filtered(lambda r: r.user_not_logged) + else: + return self._get_pages().filtered(lambda r: r.user_logged) + + @api.multi + def _get_page_access(self, url): + # active pages + active_urls = self._get_pages() + + # compose access page url + base_url = u'/page/' + base_url += url + + # check users (Public or Logged) + if self._check_user_access(): + return active_urls.filtered( + lambda r: r.user_not_logged and r.url == base_url) + else: + return active_urls.filtered( + lambda r: r.user_logged and r.url == base_url) + + @api.model + def _check_template(self, response, page): + template = request.env['ir.ui.view'] + try: + template = http.request.env.ref(response.template, + raise_if_not_found=False) + except Exception: + logger.exception("Failed to load local template %r", page) + return template + + @api.multi + def _default_response(self, page, **opt): + """ + This is for custom rendering page + :param page: requested by user + :param opt: parameters + :return: custom 404 or page requested + """ + + # website response + default_response = super(Website, self).page(page, **opt) + + # accessible pages + to_display = self._get_page_access(page) + + # bad request or access denied + bad_request = request.render('website.404', { + 'suggest_page': self._get_suggest_page()}) + + # managed pages for users are unique string + simple_page = True + if len(page.split('.')) > 1: + simple_page = False + + # 404 page + page_404 = u'page_404' + + # check template exists (avoid render 404 for page added by another + # module like contactus_thanks page in website_crm module) + template = self._check_template(default_response, page) + + if template and template.name == page_404 or not template: + default_response = bad_request + elif template and template.name == page_404 and not to_display: + default_response = bad_request + elif template and template.name != \ + page_404 and simple_page and not to_display: + default_response = bad_request + return default_response + + @http.route('/', type='http', auth="public", website=True) + def index(self, **kw): + # Do not return 404 for odoo backend menu + main_menu = request.env.ref('website.main_menu', + raise_if_not_found=False) + if not main_menu: + url = request.httprequest.referrer.split('/')[-1] + return self._default_response(url, **kw) + return super(Website, self).index(**kw) + + @http.route('/page/', type='http', auth="public", website=True, + cache=300) + def page(self, page, **opt): + return self._default_response(page, **opt) diff --git a/website_menu_by_user_status/models/__init__.py b/website_menu_by_user_status/models/__init__.py index a8462e5b88..396181b420 100644 --- a/website_menu_by_user_status/models/__init__.py +++ b/website_menu_by_user_status/models/__init__.py @@ -1,22 +1,5 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2010 - 2014 Savoir-faire Linux -# (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import website_menu + diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index 255ee69649..58ab8fcc44 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -1,27 +1,8 @@ -# -*- encoding: utf-8 -*- -# -# OpenERP, Open Source Management Solution -# This module copyright (C) 2013 Savoir-faire Linux -# (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# +# -*- coding: utf-8 -*- +# Copyright 2013-2017 Savoir-faire Linux () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import logging -_logger = logging.getLogger(__name__) -from openerp import models, fields -from openerp.tools.translate import _ +from odoo import models, fields, _ class WebsiteMenu(models.Model): @@ -34,12 +15,14 @@ class WebsiteMenu(models.Model): string="User Logged", default=True, help=_("If checked, " - "the menu will be displayed when the user is logged.") + "the menu will be displayed when the user is logged " + "and give access.") ) user_not_logged = fields.Boolean( string="User Not Logged", default=True, help=_("If checked, " - "the menu will be displayed when the user is not logged.") + "the menu will be displayed when the user is not logged " + "and give access.") ) diff --git a/website_menu_by_user_status/views/website_templates.xml b/website_menu_by_user_status/views/website_templates.xml index 0203ed864e..b28ac1e1a4 100644 --- a/website_menu_by_user_status/views/website_templates.xml +++ b/website_menu_by_user_status/views/website_templates.xml @@ -1,5 +1,8 @@ - + + - + + + diff --git a/website_menu_by_user_status/views/website_views.xml b/website_menu_by_user_status/views/website_views.xml index 32c67e051e..27f61054a0 100644 --- a/website_menu_by_user_status/views/website_views.xml +++ b/website_menu_by_user_status/views/website_views.xml @@ -1,5 +1,7 @@ - + + Website.menu: Display to user booleans @@ -13,4 +15,4 @@ - + From a74233c29762ed3c6ff07117a758dc647d38cab3 Mon Sep 17 00:00:00 2001 From: David Dufresne Date: Tue, 27 Feb 2018 10:17:54 -0500 Subject: [PATCH 04/19] [MIG][11.0] website_menu_by_user_status Extending the controllers and the website xml templates is not required anymore because the field is_visible on website.menu is computed. --- website_menu_by_user_status/README.rst | 40 ++---- website_menu_by_user_status/__init__.py | 3 - website_menu_by_user_status/__manifest__.py | 8 +- .../controllers/__init__.py | 1 - .../controllers/main.py | 122 ------------------ .../i18n/website_menu_by_user_status.pot | 34 ----- .../models/__init__.py | 2 - .../models/website_menu.py | 16 ++- website_menu_by_user_status/tests/__init__.py | 4 + .../tests/test_website_menu.py | 56 ++++++++ .../{website_views.xml => website_menu.xml} | 0 .../views/website_templates.xml | 46 ------- 12 files changed, 88 insertions(+), 244 deletions(-) delete mode 100644 website_menu_by_user_status/controllers/__init__.py delete mode 100644 website_menu_by_user_status/controllers/main.py delete mode 100644 website_menu_by_user_status/i18n/website_menu_by_user_status.pot create mode 100644 website_menu_by_user_status/tests/__init__.py create mode 100644 website_menu_by_user_status/tests/test_website_menu.py rename website_menu_by_user_status/views/{website_views.xml => website_menu.xml} (100%) delete mode 100644 website_menu_by_user_status/views/website_templates.xml diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index af4963b10c..9244db175d 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -9,34 +9,17 @@ Website Menu By User Status The module manages display website menu entries, depending if the user is logged or not. The selection of the display status can be chosen logged and/or not. -Extends features and view of website.menu model. -But for modules that install new routes like _your_wesite_/shop or _your_wesite_/event -the redirection will not work in such cases. - -Installation -============ - -To install this module, just click to install butto - -Configuration -============= - -#. you must activate the developer mode Usage ===== -To use this module, you need to edit website menu pages list view that can be found at : -Website Admin > Configuration > Settings > Configure website menus +To use this module, you need to: -#. remove default filter to edit website menu line +#. Go to Website > Configuration > Settings > Pages. +#. Select the page for which you would like to hide the menu. +#. In the `Related Menu Items` table, check whether the menu item is visible for logged/unlogged users. -The module inherit from website.menu to add 2 booleans fields, user_logged -and user_not_logged. -On top of that, website.layout template is extended to include a condition -that drive if the menu is built or not. -It has been choose to not only hide the menu to avoid to easily get around -by editing the html DOM. +#. remove default filter to edit website menu line Bug Tracker =========== @@ -46,23 +29,22 @@ Bugs are tracked on `GitHub Issues check there if your issue has already been reported. If you spotted it first, help us smash it by providing detailed and welcomed feedback. +Credits +======= + Images ------ -* Odoo Community Association: `Icon `_. - +* Odoo Community Association: `Icon `_. Contributors ------------ * Bruno Joliveau * Jordi Riera * Meyomesse Gilles +* David Dufresne -More information ----------------- -Module developed and tested with Odoo version 10.0 -For questions, please contact our support services - +Do not contact contributors directly about support or help with technical issues. Maintainer ---------- diff --git a/website_menu_by_user_status/__init__.py b/website_menu_by_user_status/__init__.py index 3b2f171ce3..69f7babdfb 100644 --- a/website_menu_by_user_status/__init__.py +++ b/website_menu_by_user_status/__init__.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models -from . import controllers - diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index fed4a6c578..0e29a04435 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -1,11 +1,10 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2017 Savoir-faire Linux () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Website Menu By User Display', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', - 'website': 'http://www.savoirfairelinux.com', + 'website': 'https://github.com/OCA/website', 'license': 'AGPL-3', 'category': 'Website', 'summary': 'Allow to manage the display of website.menus', @@ -13,8 +12,7 @@ 'website', ], 'data': [ - 'views/website_templates.xml', - 'views/website_views.xml', + 'views/website_menu.xml', ], 'installable': True, } diff --git a/website_menu_by_user_status/controllers/__init__.py b/website_menu_by_user_status/controllers/__init__.py deleted file mode 100644 index 12a7e529b6..0000000000 --- a/website_menu_by_user_status/controllers/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import main diff --git a/website_menu_by_user_status/controllers/main.py b/website_menu_by_user_status/controllers/main.py deleted file mode 100644 index dd0d7b02fa..0000000000 --- a/website_menu_by_user_status/controllers/main.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2017 ACSONE SA/NV -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -import logging - -from odoo import http -from odoo.http import request - -from odoo.addons.web.controllers.main import Home -from odoo import api - -logger = logging.getLogger(__name__) - - -class Website(Home): - - @api.model - def _get_pages(self): - """ - All pages width url - """ - return request.env['website.menu'].search([]).filtered('url') - - @api.multi - def _check_user_access(self): - """ - Is user logged - """ - return request.env.user == request.website.user_id or False - - @api.multi - def _get_suggest_page(self): - """ - All pages accessible by the user (logged or not) - """ - if self._check_user_access(): - return self._get_pages().filtered(lambda r: r.user_not_logged) - else: - return self._get_pages().filtered(lambda r: r.user_logged) - - @api.multi - def _get_page_access(self, url): - # active pages - active_urls = self._get_pages() - - # compose access page url - base_url = u'/page/' - base_url += url - - # check users (Public or Logged) - if self._check_user_access(): - return active_urls.filtered( - lambda r: r.user_not_logged and r.url == base_url) - else: - return active_urls.filtered( - lambda r: r.user_logged and r.url == base_url) - - @api.model - def _check_template(self, response, page): - template = request.env['ir.ui.view'] - try: - template = http.request.env.ref(response.template, - raise_if_not_found=False) - except Exception: - logger.exception("Failed to load local template %r", page) - return template - - @api.multi - def _default_response(self, page, **opt): - """ - This is for custom rendering page - :param page: requested by user - :param opt: parameters - :return: custom 404 or page requested - """ - - # website response - default_response = super(Website, self).page(page, **opt) - - # accessible pages - to_display = self._get_page_access(page) - - # bad request or access denied - bad_request = request.render('website.404', { - 'suggest_page': self._get_suggest_page()}) - - # managed pages for users are unique string - simple_page = True - if len(page.split('.')) > 1: - simple_page = False - - # 404 page - page_404 = u'page_404' - - # check template exists (avoid render 404 for page added by another - # module like contactus_thanks page in website_crm module) - template = self._check_template(default_response, page) - - if template and template.name == page_404 or not template: - default_response = bad_request - elif template and template.name == page_404 and not to_display: - default_response = bad_request - elif template and template.name != \ - page_404 and simple_page and not to_display: - default_response = bad_request - return default_response - - @http.route('/', type='http', auth="public", website=True) - def index(self, **kw): - # Do not return 404 for odoo backend menu - main_menu = request.env.ref('website.main_menu', - raise_if_not_found=False) - if not main_menu: - url = request.httprequest.referrer.split('/')[-1] - return self._default_response(url, **kw) - return super(Website, self).index(**kw) - - @http.route('/page/', type='http', auth="public", website=True, - cache=300) - def page(self, page, **opt): - return self._default_response(page, **opt) diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot deleted file mode 100644 index 6dfd523128..0000000000 --- a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot +++ /dev/null @@ -1,34 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * website_menu_by_user_status -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-02-02 14:37+0000\n" -"PO-Revision-Date: 2015-02-02 14:37+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: website_menu_by_user_status -#: code:addons/website_menu_by_user_status/models/website_menu.py:36 -#, python-format -msgid "If checked, the menu will be displayed when the user is logged." -msgstr "" - -#. module: website_menu_by_user_status -#: code:addons/website_menu_by_user_status/models/website_menu.py:43 -#, python-format -msgid "If checked, the menu will be displayed when the user is not logged." -msgstr "" - -#. module: website_menu_by_user_status -#: model:ir.model,name:website_menu_by_user_status.model_website_menu -msgid "Website Menu" -msgstr "" - diff --git a/website_menu_by_user_status/models/__init__.py b/website_menu_by_user_status/models/__init__.py index 396181b420..28a1362d67 100644 --- a/website_menu_by_user_status/models/__init__.py +++ b/website_menu_by_user_status/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import website_menu - diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index 58ab8fcc44..663b15a428 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -1,14 +1,14 @@ -# -*- coding: utf-8 -*- # Copyright 2013-2017 Savoir-faire Linux () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, _ +from odoo import api, fields, models, _ class WebsiteMenu(models.Model): """Improve website.menu with adding booleans that drive if the menu is displayed when the user is logger or not. """ + _inherit = 'website.menu' user_logged = fields.Boolean( @@ -26,3 +26,15 @@ class WebsiteMenu(models.Model): "the menu will be displayed when the user is not logged " "and give access.") ) + + @api.one + def _compute_visible(self): + """Display the menu item whether the user is logged or not.""" + super()._compute_visible() + if not self.is_visible: + return + + if self.env.user == self.env.ref('base.public_user'): + self.is_visible = self.user_not_logged + else: + self.is_visible = self.user_logged diff --git a/website_menu_by_user_status/tests/__init__.py b/website_menu_by_user_status/tests/__init__.py new file mode 100644 index 0000000000..53ac973554 --- /dev/null +++ b/website_menu_by_user_status/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2018 David Dufresne +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_website_menu diff --git a/website_menu_by_user_status/tests/test_website_menu.py b/website_menu_by_user_status/tests/test_website_menu.py new file mode 100644 index 0000000000..cc1dd70888 --- /dev/null +++ b/website_menu_by_user_status/tests/test_website_menu.py @@ -0,0 +1,56 @@ +# Copyright 2018 David Dufresne +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import SavepointCase + + +class TestWebsiteMenu(SavepointCase): + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.page = cls.env.ref('website.contactus_page') + cls.page.is_visible = False + + cls.menu = cls.env.ref('website.menu_contactus') + cls.menu.user_logged = False + cls.menu.user_not_logged = False + + cls.public_user = cls.env.ref('base.public_user') + cls.demo_user = cls.env.ref('base.user_demo') + + def test_visible_user_logged_demo(self): + self.page.is_visible = True + self.menu.user_logged = True + self.assertTrue(self.menu.sudo(self.demo_user).is_visible) + + def test_visible_user_logged_public(self): + self.page.is_visible = True + self.menu.user_logged = True + self.assertFalse(self.menu.sudo(self.public_user).is_visible) + + def test_visible_user_not_logged_demo(self): + self.page.is_visible = True + self.user_not_logged = True + self.assertFalse(self.menu.sudo(self.demo_user).is_visible) + + def test_visible_user_not_logged_public(self): + self.page.is_visible = True + self.user_not_logged = True + self.assertFalse(self.menu.sudo(self.public_user).is_visible) + + def test_not_visible_user_logged_demo(self): + self.menu.user_logged = True + self.assertTrue(self.menu.sudo(self.demo_user).is_visible) + + def test_not_visible_user_logged_public(self): + self.menu.user_logged = True + self.assertFalse(self.menu.sudo(self.public_user).is_visible) + + def test_not_visible_user_not_logged_demo(self): + self.user_not_logged = True + self.assertFalse(self.menu.sudo(self.demo_user).is_visible) + + def test_not_visible_user_not_logged_public(self): + self.user_not_logged = True + self.assertFalse(self.menu.sudo(self.public_user).is_visible) diff --git a/website_menu_by_user_status/views/website_views.xml b/website_menu_by_user_status/views/website_menu.xml similarity index 100% rename from website_menu_by_user_status/views/website_views.xml rename to website_menu_by_user_status/views/website_menu.xml diff --git a/website_menu_by_user_status/views/website_templates.xml b/website_menu_by_user_status/views/website_templates.xml deleted file mode 100644 index b28ac1e1a4..0000000000 --- a/website_menu_by_user_status/views/website_templates.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - From 932d49c91b2836a3f6310fcdde9b40b03a63824c Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 20 Jun 2018 23:12:36 +0000 Subject: [PATCH 05/19] [UPD] Update website_menu_by_user_status.pot --- .../i18n/website_menu_by_user_status.pot | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 website_menu_by_user_status/i18n/website_menu_by_user_status.pot diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot new file mode 100644 index 0000000000..71f61ed7a3 --- /dev/null +++ b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: website_menu_by_user_status +#: code:addons/website_menu_by_user_status/models/website_menu.py:17 +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu_user_logged +#, python-format +msgid "If checked, the menu will be displayed when the user is logged and give access." +msgstr "" + +#. module: website_menu_by_user_status +#: code:addons/website_menu_by_user_status/models/website_menu.py:25 +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu_user_not_logged +#, python-format +msgid "If checked, the menu will be displayed when the user is not logged and give access." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu_user_logged +msgid "User Logged" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu_user_not_logged +msgid "User Not Logged" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "" + From 49ab49479c653f87763219884e8ea8f8b5a4bf08 Mon Sep 17 00:00:00 2001 From: Kaushal Prajapati Date: Tue, 8 Jan 2019 15:52:41 +0530 Subject: [PATCH 06/19] [MIG] website_menu_by_user_status: Migration to 12.0 --- website_menu_by_user_status/README.rst | 9 +++++ website_menu_by_user_status/__manifest__.py | 2 +- .../models/website_menu.py | 4 +-- .../readme/CONTRIBUTORS.rst | 5 +++ .../readme/DESCRIPTION.rst | 3 ++ .../readme/ROADMAP.rst | 1 + website_menu_by_user_status/readme/USAGE.rst | 7 ++++ .../views/website_menu.xml | 35 ++++++++++++------- 8 files changed, 51 insertions(+), 15 deletions(-) create mode 100644 website_menu_by_user_status/readme/CONTRIBUTORS.rst create mode 100644 website_menu_by_user_status/readme/DESCRIPTION.rst create mode 100644 website_menu_by_user_status/readme/ROADMAP.rst create mode 100644 website_menu_by_user_status/readme/USAGE.rst diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index 9244db175d..159ea1b6c9 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -21,6 +21,14 @@ To use this module, you need to: #. remove default filter to edit website menu line +Roadmap +======= + +Point to improve + +* 2 flags will just toggle specific groups automatically [based on https://github.com/OCA/website/tree/11.0/website_menu_permission] + + Bug Tracker =========== @@ -43,6 +51,7 @@ Contributors * Jordi Riera * Meyomesse Gilles * David Dufresne +* Kaushal Prajapati Do not contact contributors directly about support or help with technical issues. diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index 0e29a04435..a25d1f9a6a 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Website Menu By User Display', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/website', 'license': 'AGPL-3', diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index 663b15a428..779874e30c 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -12,7 +12,7 @@ class WebsiteMenu(models.Model): _inherit = 'website.menu' user_logged = fields.Boolean( - string="User Logged", + string="Visible for logged Users", default=True, help=_("If checked, " "the menu will be displayed when the user is logged " @@ -20,7 +20,7 @@ class WebsiteMenu(models.Model): ) user_not_logged = fields.Boolean( - string="User Not Logged", + string="Visible for public Users", default=True, help=_("If checked, " "the menu will be displayed when the user is not logged " diff --git a/website_menu_by_user_status/readme/CONTRIBUTORS.rst b/website_menu_by_user_status/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000000..88c27f0124 --- /dev/null +++ b/website_menu_by_user_status/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Bruno Joliveau +* Jordi Riera +* Meyomesse Gilles +* David Dufresne +* Kaushal Prajapati \ No newline at end of file diff --git a/website_menu_by_user_status/readme/DESCRIPTION.rst b/website_menu_by_user_status/readme/DESCRIPTION.rst new file mode 100644 index 0000000000..504513c6ff --- /dev/null +++ b/website_menu_by_user_status/readme/DESCRIPTION.rst @@ -0,0 +1,3 @@ +The module manages display website menu entries, depending if the user is +logged or not. +The selection of the display status can be chosen logged and/or not. \ No newline at end of file diff --git a/website_menu_by_user_status/readme/ROADMAP.rst b/website_menu_by_user_status/readme/ROADMAP.rst new file mode 100644 index 0000000000..993b646689 --- /dev/null +++ b/website_menu_by_user_status/readme/ROADMAP.rst @@ -0,0 +1 @@ +* 2 flags will just toggle specific groups automatically [based on https://github.com/OCA/website/tree/11.0/website_menu_permission] \ No newline at end of file diff --git a/website_menu_by_user_status/readme/USAGE.rst b/website_menu_by_user_status/readme/USAGE.rst new file mode 100644 index 0000000000..8311a92af1 --- /dev/null +++ b/website_menu_by_user_status/readme/USAGE.rst @@ -0,0 +1,7 @@ +To use this module, you need to: + +#. Go to Website > Configuration > Settings > Pages. +#. Select the page for which you would like to hide the menu. +#. In the `Related Menu Items` table, check whether the menu item is visible for logged/unlogged users. + +#. remove default filter to edit website menu line \ No newline at end of file diff --git a/website_menu_by_user_status/views/website_menu.xml b/website_menu_by_user_status/views/website_menu.xml index 27f61054a0..fb353289c8 100644 --- a/website_menu_by_user_status/views/website_menu.xml +++ b/website_menu_by_user_status/views/website_menu.xml @@ -2,17 +2,28 @@ - - - Website.menu: Display to user booleans - website.menu - - - - - - + + Website.menu: Display to user booleans + website.menu + + + + + - - + + + + + Website.menu: Display to user booleans + website.menu + + + + + + + + + From 23c76ed25f9df51eb6ea8c504e6bee1bc7f11baa Mon Sep 17 00:00:00 2001 From: Ioan Galan Date: Wed, 21 Oct 2020 09:13:56 +0200 Subject: [PATCH 07/19] [IMP] website_menu_by_user_status: black, isort, prettier --- website_menu_by_user_status/__manifest__.py | 24 ++++++++----------- .../models/website_menu.py | 22 ++++++++++------- .../readme/CONTRIBUTORS.rst | 2 +- .../readme/DESCRIPTION.rst | 2 +- .../readme/ROADMAP.rst | 2 +- website_menu_by_user_status/readme/USAGE.rst | 2 +- .../tests/test_website_menu.py | 9 ++++--- .../views/website_menu.xml | 16 ++++++------- 8 files changed, 38 insertions(+), 41 deletions(-) diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index a25d1f9a6a..5a41e87a8f 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -1,18 +1,14 @@ # Copyright 2013-2017 Savoir-faire Linux () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Website Menu By User Display', - 'version': '12.0.1.0.0', - 'author': 'Savoir-faire Linux,Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/website', - 'license': 'AGPL-3', - 'category': 'Website', - 'summary': 'Allow to manage the display of website.menus', - 'depends': [ - 'website', - ], - 'data': [ - 'views/website_menu.xml', - ], - 'installable': True, + "name": "Website Menu By User Display", + "version": "12.0.1.0.0", + "author": "Savoir-faire Linux,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/website", + "license": "AGPL-3", + "category": "Website", + "summary": "Allow to manage the display of website.menus", + "depends": ["website",], + "data": ["views/website_menu.xml",], + "installable": True, } diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index 779874e30c..b87809de68 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -1,7 +1,7 @@ # Copyright 2013-2017 Savoir-faire Linux () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models class WebsiteMenu(models.Model): @@ -9,22 +9,26 @@ class WebsiteMenu(models.Model): if the menu is displayed when the user is logger or not. """ - _inherit = 'website.menu' + _inherit = "website.menu" user_logged = fields.Boolean( string="Visible for logged Users", default=True, - help=_("If checked, " - "the menu will be displayed when the user is logged " - "and give access.") + help=_( + "If checked, " + "the menu will be displayed when the user is logged " + "and give access." + ), ) user_not_logged = fields.Boolean( string="Visible for public Users", default=True, - help=_("If checked, " - "the menu will be displayed when the user is not logged " - "and give access.") + help=_( + "If checked, " + "the menu will be displayed when the user is not logged " + "and give access." + ), ) @api.one @@ -34,7 +38,7 @@ def _compute_visible(self): if not self.is_visible: return - if self.env.user == self.env.ref('base.public_user'): + if self.env.user == self.env.ref("base.public_user"): self.is_visible = self.user_not_logged else: self.is_visible = self.user_logged diff --git a/website_menu_by_user_status/readme/CONTRIBUTORS.rst b/website_menu_by_user_status/readme/CONTRIBUTORS.rst index 88c27f0124..87066bfb26 100644 --- a/website_menu_by_user_status/readme/CONTRIBUTORS.rst +++ b/website_menu_by_user_status/readme/CONTRIBUTORS.rst @@ -2,4 +2,4 @@ * Jordi Riera * Meyomesse Gilles * David Dufresne -* Kaushal Prajapati \ No newline at end of file +* Kaushal Prajapati diff --git a/website_menu_by_user_status/readme/DESCRIPTION.rst b/website_menu_by_user_status/readme/DESCRIPTION.rst index 504513c6ff..ac13753c55 100644 --- a/website_menu_by_user_status/readme/DESCRIPTION.rst +++ b/website_menu_by_user_status/readme/DESCRIPTION.rst @@ -1,3 +1,3 @@ The module manages display website menu entries, depending if the user is logged or not. -The selection of the display status can be chosen logged and/or not. \ No newline at end of file +The selection of the display status can be chosen logged and/or not. diff --git a/website_menu_by_user_status/readme/ROADMAP.rst b/website_menu_by_user_status/readme/ROADMAP.rst index 993b646689..43b36e8901 100644 --- a/website_menu_by_user_status/readme/ROADMAP.rst +++ b/website_menu_by_user_status/readme/ROADMAP.rst @@ -1 +1 @@ -* 2 flags will just toggle specific groups automatically [based on https://github.com/OCA/website/tree/11.0/website_menu_permission] \ No newline at end of file +* 2 flags will just toggle specific groups automatically [based on https://github.com/OCA/website/tree/11.0/website_menu_permission] diff --git a/website_menu_by_user_status/readme/USAGE.rst b/website_menu_by_user_status/readme/USAGE.rst index 8311a92af1..f68329ac61 100644 --- a/website_menu_by_user_status/readme/USAGE.rst +++ b/website_menu_by_user_status/readme/USAGE.rst @@ -4,4 +4,4 @@ To use this module, you need to: #. Select the page for which you would like to hide the menu. #. In the `Related Menu Items` table, check whether the menu item is visible for logged/unlogged users. -#. remove default filter to edit website menu line \ No newline at end of file +#. remove default filter to edit website menu line diff --git a/website_menu_by_user_status/tests/test_website_menu.py b/website_menu_by_user_status/tests/test_website_menu.py index cc1dd70888..e01872369c 100644 --- a/website_menu_by_user_status/tests/test_website_menu.py +++ b/website_menu_by_user_status/tests/test_website_menu.py @@ -5,19 +5,18 @@ class TestWebsiteMenu(SavepointCase): - @classmethod def setUpClass(cls): super().setUpClass() - cls.page = cls.env.ref('website.contactus_page') + cls.page = cls.env.ref("website.contactus_page") cls.page.is_visible = False - cls.menu = cls.env.ref('website.menu_contactus') + cls.menu = cls.env.ref("website.menu_contactus") cls.menu.user_logged = False cls.menu.user_not_logged = False - cls.public_user = cls.env.ref('base.public_user') - cls.demo_user = cls.env.ref('base.user_demo') + cls.public_user = cls.env.ref("base.public_user") + cls.demo_user = cls.env.ref("base.user_demo") def test_visible_user_logged_demo(self): self.page.is_visible = True diff --git a/website_menu_by_user_status/views/website_menu.xml b/website_menu_by_user_status/views/website_menu.xml index fb353289c8..f96bea3570 100644 --- a/website_menu_by_user_status/views/website_menu.xml +++ b/website_menu_by_user_status/views/website_menu.xml @@ -1,29 +1,27 @@ - + Website.menu: Display to user booleans website.menu - + - - + + - Website.menu: Display to user booleans website.menu - + - - + + - From 774c5337be7ba9b316e8558a98c729b79e4c68db Mon Sep 17 00:00:00 2001 From: Ioan Galan Date: Wed, 21 Oct 2020 09:17:49 +0200 Subject: [PATCH 08/19] [MIG] website_menu_by_user_status: Migration to 13.0 --- website_menu_by_user_status/README.rst | 76 ++- website_menu_by_user_status/__manifest__.py | 6 +- .../models/website_menu.py | 34 +- .../static/description/index.html | 443 ++++++++++++++++++ .../tests/test_website_menu.py | 16 +- 5 files changed, 519 insertions(+), 56 deletions(-) create mode 100644 website_menu_by_user_status/static/description/index.html diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index 159ea1b6c9..a84c53512a 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -1,15 +1,39 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -=========================== -Website Menu By User Status -=========================== +============================ +Website Menu By User Display +============================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github + :target: https://github.com/OCA/website/tree/13.0/website_menu_by_user_status + :alt: OCA/website +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/website-13-0/website-13-0-website_menu_by_user_status + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/186/13.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| The module manages display website menu entries, depending if the user is logged or not. The selection of the display status can be chosen logged and/or not. +**Table of contents** + +.. contents:: + :local: + Usage ===== @@ -21,51 +45,51 @@ To use this module, you need to: #. remove default filter to edit website menu line -Roadmap -======= - -Point to improve +Known issues / Roadmap +====================== * 2 flags will just toggle specific groups automatically [based on https://github.com/OCA/website/tree/11.0/website_menu_permission] - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smash it by providing detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Savoir-faire Linux Contributors ------------- +~~~~~~~~~~~~ + * Bruno Joliveau * Jordi Riera * Meyomesse Gilles * David Dufresne * Kaushal Prajapati -Do not contact contributors directly about support or help with technical issues. +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file +This module is part of the `OCA/website `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index 5a41e87a8f..558e76e3b6 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -2,13 +2,13 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Website Menu By User Display", - "version": "12.0.1.0.0", + "version": "13.0.1.0.0", "author": "Savoir-faire Linux,Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "AGPL-3", "category": "Website", "summary": "Allow to manage the display of website.menus", - "depends": ["website",], - "data": ["views/website_menu.xml",], + "depends": ["website"], + "data": ["views/website_menu.xml"], "installable": True, } diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index b87809de68..979b676a8a 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -1,7 +1,7 @@ # Copyright 2013-2017 Savoir-faire Linux () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models +from odoo import fields, models class WebsiteMenu(models.Model): @@ -14,31 +14,27 @@ class WebsiteMenu(models.Model): user_logged = fields.Boolean( string="Visible for logged Users", default=True, - help=_( - "If checked, " - "the menu will be displayed when the user is logged " - "and give access." - ), + help="If checked, " + "the menu will be displayed when the user is logged " + "and give access.", ) user_not_logged = fields.Boolean( string="Visible for public Users", default=True, - help=_( - "If checked, " - "the menu will be displayed when the user is not logged " - "and give access." - ), + help="If checked, " + "the menu will be displayed when the user is not logged " + "and give access.", ) - @api.one def _compute_visible(self): """Display the menu item whether the user is logged or not.""" super()._compute_visible() - if not self.is_visible: - return - - if self.env.user == self.env.ref("base.public_user"): - self.is_visible = self.user_not_logged - else: - self.is_visible = self.user_logged + for menu in self: + if not menu.is_visible: + return + + if self.env.user == self.env.ref("base.public_user"): + menu.is_visible = menu.user_not_logged + else: + menu.is_visible = menu.user_logged diff --git a/website_menu_by_user_status/static/description/index.html b/website_menu_by_user_status/static/description/index.html new file mode 100644 index 0000000000..06c2d269f9 --- /dev/null +++ b/website_menu_by_user_status/static/description/index.html @@ -0,0 +1,443 @@ + + + + + + +Website Menu By User Display + + + +
+

Website Menu By User Display

+ + +

Beta License: AGPL-3 OCA/website Translate me on Weblate Try me on Runbot

+

The module manages display website menu entries, depending if the user is +logged or not. +The selection of the display status can be chosen logged and/or not.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Website > Configuration > Settings > Pages.
  2. +
  3. Select the page for which you would like to hide the menu.
  4. +
  5. In the Related Menu Items table, check whether the menu item is visible for logged/unlogged users.
  6. +
  7. remove default filter to edit website menu line
  8. +
+
+
+

Known issues / Roadmap

+ +
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Savoir-faire Linux
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/website project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/website_menu_by_user_status/tests/test_website_menu.py b/website_menu_by_user_status/tests/test_website_menu.py index e01872369c..24354926aa 100644 --- a/website_menu_by_user_status/tests/test_website_menu.py +++ b/website_menu_by_user_status/tests/test_website_menu.py @@ -21,35 +21,35 @@ def setUpClass(cls): def test_visible_user_logged_demo(self): self.page.is_visible = True self.menu.user_logged = True - self.assertTrue(self.menu.sudo(self.demo_user).is_visible) + self.assertTrue(self.menu.with_user(self.demo_user).is_visible) def test_visible_user_logged_public(self): self.page.is_visible = True self.menu.user_logged = True - self.assertFalse(self.menu.sudo(self.public_user).is_visible) + self.assertFalse(self.menu.with_user(self.public_user).is_visible) def test_visible_user_not_logged_demo(self): self.page.is_visible = True self.user_not_logged = True - self.assertFalse(self.menu.sudo(self.demo_user).is_visible) + self.assertFalse(self.menu.with_user(self.demo_user).is_visible) def test_visible_user_not_logged_public(self): self.page.is_visible = True self.user_not_logged = True - self.assertFalse(self.menu.sudo(self.public_user).is_visible) + self.assertFalse(self.menu.with_user(self.public_user).is_visible) def test_not_visible_user_logged_demo(self): self.menu.user_logged = True - self.assertTrue(self.menu.sudo(self.demo_user).is_visible) + self.assertTrue(self.menu.with_user(self.demo_user).is_visible) def test_not_visible_user_logged_public(self): self.menu.user_logged = True - self.assertFalse(self.menu.sudo(self.public_user).is_visible) + self.assertFalse(self.menu.with_user(self.public_user).is_visible) def test_not_visible_user_not_logged_demo(self): self.user_not_logged = True - self.assertFalse(self.menu.sudo(self.demo_user).is_visible) + self.assertFalse(self.menu.with_user(self.demo_user).is_visible) def test_not_visible_user_not_logged_public(self): self.user_not_logged = True - self.assertFalse(self.menu.sudo(self.public_user).is_visible) + self.assertFalse(self.menu.with_user(self.public_user).is_visible) From dd84c09ce0b49889b6c3b60d4a73e7ca9e033e91 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Wed, 9 Dec 2020 14:55:29 +0000 Subject: [PATCH 09/19] [UPD] Update website_menu_by_user_status.pot --- .../i18n/website_menu_by_user_status.pot | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot index 71f61ed7a3..096c339fac 100644 --- a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot +++ b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * website_menu_by_user_status +# * website_menu_by_user_status # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -14,31 +14,30 @@ msgstr "" "Plural-Forms: \n" #. module: website_menu_by_user_status -#: code:addons/website_menu_by_user_status/models/website_menu.py:17 -#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu_user_logged -#, python-format -msgid "If checked, the menu will be displayed when the user is logged and give access." +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged +msgid "" +"If checked, the menu will be displayed when the user is logged and give " +"access." msgstr "" #. module: website_menu_by_user_status -#: code:addons/website_menu_by_user_status/models/website_menu.py:25 -#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu_user_not_logged -#, python-format -msgid "If checked, the menu will be displayed when the user is not logged and give access." +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "" +"If checked, the menu will be displayed when the user is not logged and give " +"access." msgstr "" #. module: website_menu_by_user_status -#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu_user_logged -msgid "User Logged" +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged +msgid "Visible for logged Users" msgstr "" #. module: website_menu_by_user_status -#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu_user_not_logged -msgid "User Not Logged" +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "Visible for public Users" msgstr "" #. module: website_menu_by_user_status #: model:ir.model,name:website_menu_by_user_status.model_website_menu msgid "Website Menu" msgstr "" - From e6860d119754b29e80d3a5536110c17c28fc9505 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Tue, 23 Feb 2021 10:07:47 +0000 Subject: [PATCH 10/19] Added translation using Weblate (Spanish) --- website_menu_by_user_status/i18n/es.po | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 website_menu_by_user_status/i18n/es.po diff --git a/website_menu_by_user_status/i18n/es.po b/website_menu_by_user_status/i18n/es.po new file mode 100644 index 0000000000..056fe2ecbb --- /dev/null +++ b/website_menu_by_user_status/i18n/es.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged +msgid "" +"If checked, the menu will be displayed when the user is logged and give " +"access." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "" +"If checked, the menu will be displayed when the user is not logged and give " +"access." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged +msgid "Visible for logged Users" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "Visible for public Users" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "" From 1a214443a22d8d251f8be5e896a47cb89bc37c39 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Tue, 23 Feb 2021 10:08:51 +0000 Subject: [PATCH 11/19] Added translation using Weblate (Catalan) --- website_menu_by_user_status/i18n/ca.po | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 website_menu_by_user_status/i18n/ca.po diff --git a/website_menu_by_user_status/i18n/ca.po b/website_menu_by_user_status/i18n/ca.po new file mode 100644 index 0000000000..1613121585 --- /dev/null +++ b/website_menu_by_user_status/i18n/ca.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged +msgid "" +"If checked, the menu will be displayed when the user is logged and give " +"access." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "" +"If checked, the menu will be displayed when the user is not logged and give " +"access." +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged +msgid "Visible for logged Users" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "Visible for public Users" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "" From 532e057b8d5107f51c3647cc42ad6408b6d4dad5 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Tue, 23 Feb 2021 10:08:41 +0000 Subject: [PATCH 12/19] Translated using Weblate (Spanish) Currently translated at 100.0% (5 of 5 strings) Translation: website-13.0/website-13.0-website_menu_by_user_status Translate-URL: https://translation.odoo-community.org/projects/website-13-0/website-13-0-website_menu_by_user_status/es/ --- website_menu_by_user_status/i18n/es.po | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/website_menu_by_user_status/i18n/es.po b/website_menu_by_user_status/i18n/es.po index 056fe2ecbb..fda9d424fd 100644 --- a/website_menu_by_user_status/i18n/es.po +++ b/website_menu_by_user_status/i18n/es.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-02-23 12:45+0000\n" +"Last-Translator: claudiagn \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged @@ -20,6 +22,7 @@ msgid "" "If checked, the menu will be displayed when the user is logged and give " "access." msgstr "" +"Si se marca, el menú se mostrará cuando el usuario inicie sesión y dé acceso." #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged @@ -27,18 +30,20 @@ msgid "" "If checked, the menu will be displayed when the user is not logged and give " "access." msgstr "" +"Si se marca, el menú se mostrará cuando el usuario no esté registrado y no " +"le dé acceso." #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged msgid "Visible for logged Users" -msgstr "" +msgstr "Visible para usuarios registrados" #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged msgid "Visible for public Users" -msgstr "" +msgstr "Visible para usuarios públicos" #. module: website_menu_by_user_status #: model:ir.model,name:website_menu_by_user_status.model_website_menu msgid "Website Menu" -msgstr "" +msgstr "Menú del sitio web" From a296339265373b803082d8b220b3de46d4428975 Mon Sep 17 00:00:00 2001 From: claudiagn Date: Tue, 23 Feb 2021 10:09:34 +0000 Subject: [PATCH 13/19] Translated using Weblate (Catalan) Currently translated at 100.0% (5 of 5 strings) Translation: website-13.0/website-13.0-website_menu_by_user_status Translate-URL: https://translation.odoo-community.org/projects/website-13-0/website-13-0-website_menu_by_user_status/ca/ --- website_menu_by_user_status/i18n/ca.po | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/website_menu_by_user_status/i18n/ca.po b/website_menu_by_user_status/i18n/ca.po index 1613121585..b50fe5ab81 100644 --- a/website_menu_by_user_status/i18n/ca.po +++ b/website_menu_by_user_status/i18n/ca.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2021-02-23 12:45+0000\n" +"Last-Translator: claudiagn \n" "Language-Team: none\n" "Language: ca\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged @@ -20,6 +22,8 @@ msgid "" "If checked, the menu will be displayed when the user is logged and give " "access." msgstr "" +"Si està marcat, el menú es mostrarà quan l'usuari estigui registrat i hi " +"doni accés." #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged @@ -27,18 +31,20 @@ msgid "" "If checked, the menu will be displayed when the user is not logged and give " "access." msgstr "" +"Si està marcat, el menú es mostrarà quan l'usuari no estigui registrat i hi " +"doni accés." #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged msgid "Visible for logged Users" -msgstr "" +msgstr "Visible per als usuaris registrats" #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged msgid "Visible for public Users" -msgstr "" +msgstr "Visible per als usuaris públics" #. module: website_menu_by_user_status #: model:ir.model,name:website_menu_by_user_status.model_website_menu msgid "Website Menu" -msgstr "" +msgstr "Menú del lloc web" From b12962160810e7fa7481b6c262ebc733331c8bad Mon Sep 17 00:00:00 2001 From: "@" <@> Date: Tue, 5 Jul 2022 11:59:36 +0200 Subject: [PATCH 14/19] [MIG][website_menu_by_user_status] Migration [FIX][website_menu_by_user_status] fix travis [FIX][website_menu_by_user_status] force sudo Revert "[FIX][website_menu_by_user_status] force sudo" This reverts commit 71d579ce9ac1c855512726487facf6e72cca2029. --- website_menu_by_user_status/__manifest__.py | 2 +- website_menu_by_user_status/models/website_menu.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website_menu_by_user_status/__manifest__.py b/website_menu_by_user_status/__manifest__.py index 558e76e3b6..514cf2dcd3 100644 --- a/website_menu_by_user_status/__manifest__.py +++ b/website_menu_by_user_status/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Website Menu By User Display", - "version": "13.0.1.0.0", + "version": "14.0.1.0.0", "author": "Savoir-faire Linux,Odoo Community Association (OCA)", "website": "https://github.com/OCA/website", "license": "AGPL-3", diff --git a/website_menu_by_user_status/models/website_menu.py b/website_menu_by_user_status/models/website_menu.py index 979b676a8a..b5de805e6d 100644 --- a/website_menu_by_user_status/models/website_menu.py +++ b/website_menu_by_user_status/models/website_menu.py @@ -32,7 +32,7 @@ def _compute_visible(self): super()._compute_visible() for menu in self: if not menu.is_visible: - return + menu.is_visible = False if self.env.user == self.env.ref("base.public_user"): menu.is_visible = menu.user_not_logged From e7f4ad9212e0a76b7d5e364f85937ce721ce4762 Mon Sep 17 00:00:00 2001 From: "@" <@> Date: Tue, 5 Jul 2022 16:20:03 +0200 Subject: [PATCH 15/19] [FIX][website_menu_by_user_status] fix test [UPD] Update website_menu_by_user_status.pot [UPD] README.rst --- website_menu_by_user_status/README.rst | 10 +++++----- .../i18n/website_menu_by_user_status.pot | 17 ++++++++++++++++- .../static/description/index.html | 6 +++--- .../tests/test_website_menu.py | 2 ++ 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index a84c53512a..d95e4d66a9 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -14,13 +14,13 @@ Website Menu By User Display :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fwebsite-lightgray.png?logo=github - :target: https://github.com/OCA/website/tree/13.0/website_menu_by_user_status + :target: https://github.com/OCA/website/tree/14.0/website_menu_by_user_status :alt: OCA/website .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/website-13-0/website-13-0-website_menu_by_user_status + :target: https://translation.odoo-community.org/projects/website-14-0/website-14-0-website_menu_by_user_status :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/186/13.0 + :target: https://runbot.odoo-community.org/runbot/186/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -56,7 +56,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -90,6 +90,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/website `_ project on GitHub. +This module is part of the `OCA/website `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot index 096c339fac..4a2b0cb42d 100644 --- a/website_menu_by_user_status/i18n/website_menu_by_user_status.pot +++ b/website_menu_by_user_status/i18n/website_menu_by_user_status.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -13,6 +13,16 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__display_name +msgid "Display Name" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__id +msgid "ID" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged msgid "" @@ -27,6 +37,11 @@ msgid "" "access." msgstr "" +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu____last_update +msgid "Last Modified on" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged msgid "Visible for logged Users" diff --git a/website_menu_by_user_status/static/description/index.html b/website_menu_by_user_status/static/description/index.html index 06c2d269f9..c7cc2b28ba 100644 --- a/website_menu_by_user_status/static/description/index.html +++ b/website_menu_by_user_status/static/description/index.html @@ -367,7 +367,7 @@

Website Menu By User Display

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/website Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/website Translate me on Weblate Try me on Runbot

The module manages display website menu entries, depending if the user is logged or not. The selection of the display status can be chosen logged and/or not.

@@ -406,7 +406,7 @@

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -434,7 +434,7 @@

Maintainers

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/website project on GitHub.

+

This module is part of the OCA/website project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

diff --git a/website_menu_by_user_status/tests/test_website_menu.py b/website_menu_by_user_status/tests/test_website_menu.py index 24354926aa..f768e59c73 100644 --- a/website_menu_by_user_status/tests/test_website_menu.py +++ b/website_menu_by_user_status/tests/test_website_menu.py @@ -16,6 +16,8 @@ def setUpClass(cls): cls.menu.user_not_logged = False cls.public_user = cls.env.ref("base.public_user") + group_id = cls.env.ref("website.group_website_designer") + cls.public_user.groups_id = (4, group_id.id) cls.demo_user = cls.env.ref("base.user_demo") def test_visible_user_logged_demo(self): From 8d1c4637ed768817961b17444b7e7f92a2022b2b Mon Sep 17 00:00:00 2001 From: Ignacio Buioli Date: Mon, 5 Sep 2022 04:29:28 +0000 Subject: [PATCH 16/19] Added translation using Weblate (Spanish (Argentina)) Translated using Weblate (Spanish (Argentina)) Currently translated at 100.0% (8 of 8 strings) Translation: website-14.0/website-14.0-website_menu_by_user_status Translate-URL: https://translation.odoo-community.org/projects/website-14-0/website-14-0-website_menu_by_user_status/es_AR/ --- website_menu_by_user_status/i18n/es_AR.po | 65 +++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 website_menu_by_user_status/i18n/es_AR.po diff --git a/website_menu_by_user_status/i18n/es_AR.po b/website_menu_by_user_status/i18n/es_AR.po new file mode 100644 index 0000000000..e5176492e0 --- /dev/null +++ b/website_menu_by_user_status/i18n/es_AR.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-09-05 07:07+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__display_name +msgid "Display Name" +msgstr "Nombre Mostrado" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__id +msgid "ID" +msgstr "ID" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged +msgid "" +"If checked, the menu will be displayed when the user is logged and give " +"access." +msgstr "" +"Si está marcado, el menú se mostrará cuando el usuario inicie sesión y dé " +"acceso." + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "" +"If checked, the menu will be displayed when the user is not logged and give " +"access." +msgstr "" +"Si está marcado, el menú se mostrará cuando el usuario no haya iniciado " +"sesión y le dé acceso." + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu____last_update +msgid "Last Modified on" +msgstr "Última Modificación el" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged +msgid "Visible for logged Users" +msgstr "Visible para usuarios logeados" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "Visible for public Users" +msgstr "Visible para Usuarios públicos" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "Menú del Sitio Web" From 7dd9c60e39e3441c81d8d21676ef8329c8bc1308 Mon Sep 17 00:00:00 2001 From: mymage Date: Tue, 27 Dec 2022 16:08:14 +0000 Subject: [PATCH 17/19] Added translation using Weblate (Italian) Translated using Weblate (Italian) Currently translated at 100.0% (8 of 8 strings) Translation: website-14.0/website-14.0-website_menu_by_user_status Translate-URL: https://translation.odoo-community.org/projects/website-14-0/website-14-0-website_menu_by_user_status/it/ [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: website-14.0/website-14.0-website_menu_by_user_status Translate-URL: https://translation.odoo-community.org/projects/website-14-0/website-14-0-website_menu_by_user_status/ --- website_menu_by_user_status/README.rst | 15 +++-- website_menu_by_user_status/i18n/ca.po | 15 +++++ website_menu_by_user_status/i18n/es.po | 15 +++++ website_menu_by_user_status/i18n/it.po | 65 +++++++++++++++++++ .../static/description/index.html | 42 ++++++------ 5 files changed, 126 insertions(+), 26 deletions(-) create mode 100644 website_menu_by_user_status/i18n/it.po diff --git a/website_menu_by_user_status/README.rst b/website_menu_by_user_status/README.rst index d95e4d66a9..69e51990af 100644 --- a/website_menu_by_user_status/README.rst +++ b/website_menu_by_user_status/README.rst @@ -2,10 +2,13 @@ Website Menu By User Display ============================ -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a2ff455071078badb7f6294ce0f6ac5e994792077e5e29a49ff0fa8bec350232 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Website Menu By User Display .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/website-14-0/website-14-0-website_menu_by_user_status :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/186/14.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/website&target_branch=14.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| The module manages display website menu entries, depending if the user is logged or not. @@ -55,7 +58,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/website_menu_by_user_status/i18n/ca.po b/website_menu_by_user_status/i18n/ca.po index b50fe5ab81..bff41e392b 100644 --- a/website_menu_by_user_status/i18n/ca.po +++ b/website_menu_by_user_status/i18n/ca.po @@ -16,6 +16,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__display_name +msgid "Display Name" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__id +msgid "ID" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged msgid "" @@ -34,6 +44,11 @@ msgstr "" "Si està marcat, el menú es mostrarà quan l'usuari no estigui registrat i hi " "doni accés." +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu____last_update +msgid "Last Modified on" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged msgid "Visible for logged Users" diff --git a/website_menu_by_user_status/i18n/es.po b/website_menu_by_user_status/i18n/es.po index fda9d424fd..008b5727cf 100644 --- a/website_menu_by_user_status/i18n/es.po +++ b/website_menu_by_user_status/i18n/es.po @@ -16,6 +16,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 4.3.2\n" +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__display_name +msgid "Display Name" +msgstr "" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__id +msgid "ID" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged msgid "" @@ -33,6 +43,11 @@ msgstr "" "Si se marca, el menú se mostrará cuando el usuario no esté registrado y no " "le dé acceso." +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu____last_update +msgid "Last Modified on" +msgstr "" + #. module: website_menu_by_user_status #: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged msgid "Visible for logged Users" diff --git a/website_menu_by_user_status/i18n/it.po b/website_menu_by_user_status/i18n/it.po new file mode 100644 index 0000000000..c638225d90 --- /dev/null +++ b/website_menu_by_user_status/i18n/it.po @@ -0,0 +1,65 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * website_menu_by_user_status +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-12-27 17:45+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__id +msgid "ID" +msgstr "ID" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_logged +msgid "" +"If checked, the menu will be displayed when the user is logged and give " +"access." +msgstr "" +"Se selezionato, il menu verrà visualizzato quando l'utente è registrato e " +"concede l'accesso." + +#. module: website_menu_by_user_status +#: model:ir.model.fields,help:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "" +"If checked, the menu will be displayed when the user is not logged and give " +"access." +msgstr "" +"Se selezionato, il menu verrà visualizzato quando l'utente non è registrato " +"e concede l'accesso." + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_logged +msgid "Visible for logged Users" +msgstr "Visibile per gli utenti registrati" + +#. module: website_menu_by_user_status +#: model:ir.model.fields,field_description:website_menu_by_user_status.field_website_menu__user_not_logged +msgid "Visible for public Users" +msgstr "Visibile agli utenti pubblici" + +#. module: website_menu_by_user_status +#: model:ir.model,name:website_menu_by_user_status.model_website_menu +msgid "Website Menu" +msgstr "Menu sito web" diff --git a/website_menu_by_user_status/static/description/index.html b/website_menu_by_user_status/static/description/index.html index c7cc2b28ba..84f99d4e64 100644 --- a/website_menu_by_user_status/static/description/index.html +++ b/website_menu_by_user_status/static/description/index.html @@ -1,20 +1,20 @@ - + - + Website Menu By User Display