odoo: How to only show logged in users the website Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Odoo : How could I make my customer becoming users?How to enable multiple sessions in Odoo?Odoo logged user data dont update for a login userUnable SSL/TLS on Odoo Website BuilderHow to log in the same database from two different PostgreSQL roles using Odoo?Odoo chatter open by default with “Log internal note” openedHow to integrate Odoo Database with Laravel?How to link user wise sale order with website menu through codeOdoo website sections with different top menuDisable or Bypass login of odoo when trying to hit from external application

A German immigrant ancestor has a "Registration Affidavit of Alien Enemy" on file. What does that mean exactly?

Lights are flickering on and off after accidentally bumping into light switch

Can a Knight grant Knighthood to another?

What is the definining line between a helicopter and a drone a person can ride in?

Is there a verb for listening stealthily?

“Since the train was delayed for more than an hour, passengers were given a full refund.” – Why is there no article before “passengers”?

Does the Pact of the Blade warlock feature allow me to customize the properties of the pact weapon I create?

Why these surprising proportionalities of integrals involving odd zeta values?

Can I ask an author to send me his ebook?

Can a Wizard take the Magic Initiate feat and select spells from the Wizard list?

Pointing to problems without suggesting solutions

Why is ArcGIS Pro not symbolizing my entire range of values?

Can Deduction Guide have an explicit(bool) specifier?

What's the connection between Mr. Nancy and fried chicken?

Does traveling In The United States require a passport or can I use my green card if not a US citizen?

Trying to enter the Fox's den

How to charge percentage of transaction cost?

What were wait-states, and why was it only an issue for PCs?

Why are two-digit numbers in Jonathan Swift's "Gulliver's Travels" (1726) written in "German style"?

2 sample t test for sample sizes - 30,000 and 150,000

When speaking, how do you change your mind mid-sentence?

Would I be safe to drive a 23 year old truck for 7 hours / 450 miles?

What helicopter has the most rotor blades?

How is an IPA symbol that lacks a name (e.g. ɲ) called?



odoo: How to only show logged in users the website



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Odoo : How could I make my customer becoming users?How to enable multiple sessions in Odoo?Odoo logged user data dont update for a login userUnable SSL/TLS on Odoo Website BuilderHow to log in the same database from two different PostgreSQL roles using Odoo?Odoo chatter open by default with “Log internal note” openedHow to integrate Odoo Database with Laravel?How to link user wise sale order with website menu through codeOdoo website sections with different top menuDisable or Bypass login of odoo when trying to hit from external application



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I use odoo as a system in our company and want to use the website for internal news and informations. However the public should not see the website - only logged in users should! Viewers who aren't logged in should be redirected to the login screen.



Is that possible and how could I do it?










share|improve this question

















  • 1





    What have you tried so far?

    – CZoellner
    Mar 22 at 14:34

















0















I use odoo as a system in our company and want to use the website for internal news and informations. However the public should not see the website - only logged in users should! Viewers who aren't logged in should be redirected to the login screen.



Is that possible and how could I do it?










share|improve this question

















  • 1





    What have you tried so far?

    – CZoellner
    Mar 22 at 14:34













0












0








0








I use odoo as a system in our company and want to use the website for internal news and informations. However the public should not see the website - only logged in users should! Viewers who aren't logged in should be redirected to the login screen.



Is that possible and how could I do it?










share|improve this question














I use odoo as a system in our company and want to use the website for internal news and informations. However the public should not see the website - only logged in users should! Viewers who aren't logged in should be redirected to the login screen.



Is that possible and how could I do it?







odoo odoo-12






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 13:58









maximilian_csmaximilian_cs

292212




292212







  • 1





    What have you tried so far?

    – CZoellner
    Mar 22 at 14:34












  • 1





    What have you tried so far?

    – CZoellner
    Mar 22 at 14:34







1




1





What have you tried so far?

– CZoellner
Mar 22 at 14:34





What have you tried so far?

– CZoellner
Mar 22 at 14:34












2 Answers
2






active

oldest

votes


















1














When you define the route with @http.route you have a parameter "auth", where you define that. From the odoo documentation:



auth –

The type of authentication method, can on of the following:

user: The user must be authenticated and the current request will perform using the rights of the user.
public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.


Have a look to https://www.odoo.com/documentation/12.0/reference/http.html






share|improve this answer























  • That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

    – maximilian_cs
    Mar 22 at 23:07






  • 1





    It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

    – Victor G.
    Mar 25 at 16:55



















1














It is simple , just give auth="user" in your method at main.py file in controller.



@http.route('/name', type='http', csrf=False, auth='user', website=True)





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55301243%2fodoo-how-to-only-show-logged-in-users-the-website%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    When you define the route with @http.route you have a parameter "auth", where you define that. From the odoo documentation:



    auth –

    The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.


    Have a look to https://www.odoo.com/documentation/12.0/reference/http.html






    share|improve this answer























    • That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

      – maximilian_cs
      Mar 22 at 23:07






    • 1





      It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

      – Victor G.
      Mar 25 at 16:55
















    1














    When you define the route with @http.route you have a parameter "auth", where you define that. From the odoo documentation:



    auth –

    The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.


    Have a look to https://www.odoo.com/documentation/12.0/reference/http.html






    share|improve this answer























    • That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

      – maximilian_cs
      Mar 22 at 23:07






    • 1





      It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

      – Victor G.
      Mar 25 at 16:55














    1












    1








    1







    When you define the route with @http.route you have a parameter "auth", where you define that. From the odoo documentation:



    auth –

    The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.


    Have a look to https://www.odoo.com/documentation/12.0/reference/http.html






    share|improve this answer













    When you define the route with @http.route you have a parameter "auth", where you define that. From the odoo documentation:



    auth –

    The type of authentication method, can on of the following:

    user: The user must be authenticated and the current request will perform using the rights of the user.
    public: The user may or may not be authenticated. If she isn’t, the current request will perform using the shared Public user.
    none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.


    Have a look to https://www.odoo.com/documentation/12.0/reference/http.html







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 22 at 17:27









    Victor G.Victor G.

    515




    515












    • That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

      – maximilian_cs
      Mar 22 at 23:07






    • 1





      It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

      – Victor G.
      Mar 25 at 16:55


















    • That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

      – maximilian_cs
      Mar 22 at 23:07






    • 1





      It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

      – Victor G.
      Mar 25 at 16:55

















    That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

    – maximilian_cs
    Mar 22 at 23:07





    That seems like a great solution. Where can I edit these Web Controllers now to add the needed code with all the routing? Can you give me some more informations?

    – maximilian_cs
    Mar 22 at 23:07




    1




    1





    It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

    – Victor G.
    Mar 25 at 16:55






    It is like developing a website with Odoo, you have a short intro at: odoo.com/documentation/12.0/howtos/website.html

    – Victor G.
    Mar 25 at 16:55














    1














    It is simple , just give auth="user" in your method at main.py file in controller.



    @http.route('/name', type='http', csrf=False, auth='user', website=True)





    share|improve this answer



























      1














      It is simple , just give auth="user" in your method at main.py file in controller.



      @http.route('/name', type='http', csrf=False, auth='user', website=True)





      share|improve this answer

























        1












        1








        1







        It is simple , just give auth="user" in your method at main.py file in controller.



        @http.route('/name', type='http', csrf=False, auth='user', website=True)





        share|improve this answer













        It is simple , just give auth="user" in your method at main.py file in controller.



        @http.route('/name', type='http', csrf=False, auth='user', website=True)






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 6:35









        NaviNavi

        642628




        642628



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55301243%2fodoo-how-to-only-show-logged-in-users-the-website%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript