Odoo Help

2

9
15 Answers
11
Avatar

Frédéric Gilson (fgi)

--Frédéric Gilson (fgi)--

1173
| 6 5 11
Grand-Rosière, بلجيكا
--Frédéric Gilson (fgi)--
Frédéric Gilson (fgi)
30‏/4‏/2014 11:26 ص
  1. How to hide the "Shop" menu item? Go to Settings > Technical > Security > Record rules and create a new rule:

    • Object: Website Menu
    • Apply for Read access
    • Rule definition: [('url','not like','%/shop%')]
    • Group: Public
  2. How to make the eCommerce pages unreachable for people who are not registered as employees or portal users?

    • Open your shop and access the page HTML editor
    • Select the Product page
    • Add the following attribute in the first <t> tag (name="Products"): groups="base.group_user,base.group_portal"

Now you can open your website as an anonymous person. You do not retrieve the Shop menu and if you try to reach yourdatabasename/shop, you get an empty page.

4 Comments
DevBranch Company Limited, Luke Branch
11‏/7‏/2014 9:40 م

Hi Frédéric, Thanks for your post. Could this be applied in a similar manner to the following elements on the frontend: Add to Cart Shopping Cart (in header) Sales Price Quantity (ie. - +) And items in the navigation menu that are only meant for wholesale clients. I asked a similar question here (https://www.odoo.com/forum/Help-1/question/How-To-Remove-Pricing-For-Not-Logged-In-Users-on-E-commerceWebsite-for-Distributor-Business-to-Business-Sales-52924), but still do not fully understand how the Qweb markup works. I'm looking to implement something similar to Denise. Product catalog (no prices or ecommerce functionality) for the casual visitor, while allowing our distributors to sign in and place orders using the shopping cart and changing the button add to cart to add to quote. I've found a module that seems to be under development for v8 here also: https://github.com/maxmumford/website_b2b i'll post back here with what I find in regards to how it is implemented.

Scott Hart
8‏/3‏/2017 7:01 ص

Is this option still viable in Odoo 10? I've looked and can't find the same structure.

DevBranch Company Limited, Luke Branch
9‏/3‏/2017 3:20 ص

Hi Scott,

This should still be fundamentally the same process in version 10.0, although the views may have been reshuffled a little.

What exactly would you like to achieve in v10.0?

youta
11‏/3‏/2017 5:16 ص

How can I hide the product page itself, because it still showing in google search as follows www.yourdomain.com/shop/product/product_name

I tried to use this domain filter [('url','not like','%/shop/product/?\W+%')] but it didn't work.. can you help me please to write the right domain filter

1
Avatar

Hilar AK

--Hilar AK--
7429
| 6 5 11
سويسرا
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Quora:
    

            https://www.quora.com/profile/Hilar-Ak-1

Experienced Odoo developer, Functional Consultant.



Hilar AK
13‏/3‏/2017 6:35 ص

Frédéric Gilson (fgi)On 4/30/14, 8:56 PM Answered the exact way through UI. But this will not be the correct way always. We can do that in our code like in the shop controller just check the thing whether has a user and only render the e-commerce template if request has a user.

eg:

@http.route([
        '/shop',
        '/shop/page/<int:page>',
        '/shop/category/<model("product.public.category"):category>',
        '/shop/category/<model("product.public.category"):category>/page/<int:page>'
    ], type='http', auth="public", website=True)
    def shop(self, page=0, category=None, search='', ppg=False, **post):
      if request.uid:
#only render the template with other operations
return request.website.render("website_sale.products", values)
else:
return request.website.render("website_sale.error_page", {})




1 Comment
Agrista, Helmut Drewes
10‏/5‏/2018 4:35 ص

I get the following error (might be m< lack of knowledge on how to inherit controllers):

NameError: name 'values' is not defined

Also, is the "public" user also a valid user and will be able to see the products and product pages?

0
Heifara MATAPO
10‏/10‏/2017 8:39 م

@Frédéric Gilson,

Excellent solution. Does not need any module installation.

Thank you

0
Johanna Löfvenberg
30‏/3‏/2017 8:28 ص

Hi Frédéric,

I followed your steps in the HTML editor but even users that are not signed in can still see the Webshop in the menu (although the page gets blank when they click the menu item). Do you have any idea why? I tried to delete the browser history and it didn't help.

/Johanna

0
Adam Moonen
9‏/9‏/2015 7:43 م

Frédéric Gilson (fgi)   - Brilliant Answer, works every time.

0
Jonathan Hurtado
17‏/6‏/2015 4:25 م

hi,

I followed the steps, and the user is no longer able to access to mysite.com/shop.

but... the public user can still access to my shop store via google (in google I see all the items that I have on the shop) and access to "add to cart" button.

To avoid this issue:

You need to install the "Warning Messages and Alerts" module; then you need to go to Sales -> Customers -> "Public User" -> Warnings -> Warning on the Sales Order -> Blocking Message.

Regards

0
Andrés Méndez
10‏/3‏/2015 6:54 م

Hello Frédéric.

I have followed your steps, but I don't find "Rule definition" to enter that piece of code, instead I can see "Domain".

Do I have to enter it in the "Domain" field?

Thanks.

-1
Denise van der Linden
11‏/7‏/2014 6:18 م

@Luke as I cannot add a new comment or answer I'll answer to you by editing my previous answer. As far as I understand from you my wish cannot be accomplished in the SAAS version so I will not start a new post for now. In case I plan to install on VPS instead I might get back to you. Thx for your help so far.

----------------------------

 

I would like to use the webshop as a catalogue only to users who are not logged in showing public price. However only invited users (retailers) are allowed to logon and able to order at the (wholesale) pricelist assigned to them.

Therefore I'm looking for a way to only remove the "add to cart" button from the product overview and product page. Tried looking for a submit tag in the html where I could put groups="base.group_user,base.group_portal to see if this would only hide the cart button but couldn't find a spot to put it.

Anybody any suggestions?

Best regards,

 

Denise

2 Comments
DevBranch Company Limited, Luke Branch
19‏/11‏/2014 12:17 ص

@Denise, It seems that the comments are treating my code snippet as actual HTML instead of escaping it. Please create a new question thread in the forum with your question above and I will create an answer for it so as to conform with the guidelines of the forum properly.

Denise van der Linden
17‏/8‏/2015 8:56 م

@Luke, no worries as I could still understand the post above. However I'm not on a local install and exploring ODOO SAAS for a couple of years now as I feel an easy to implement solution would be the way to go forward. ODOO 9 seems another great improvement again.

Ask a Question
Keep Informed
12 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now