Skip to Content
Menu
This question has been flagged
1 Reply
821 Views

Hello,

I added a new field website_name in product.template in order to have a specific name for products in website shop.


The problem, when i add a product in cart, the name is the standard name of the product, not the specific one.

I want to override a product.product's method to change the name of the sale.order.line with the specific name, if the user is on website or with the standard name if not

How is it possible to know in a method of a class (ie product.product) that user is on website or not ?


Hope it's clear for you

Vincent

Avatar
Discard

You can know if the quotation/ sale order is created from website if the website_id in sale.order has the id of the website and if it's empty then it will be created from backend.

You can go to website app and open orders from orders menu and it will show all website orders (filtered by "From Website"), if you open one f the orders and go to other info tab you will find the website field.

Author Best Answer

Hello Waleed,

thank your for your answer but this is not my question

I don't want to know if the sale.order is created from website or not.

In fact, the standard method i want to override is get_product_multiline_description_sale() in product.product

And when i am on this method, i don't know if the order is created from website or not


Also i want to know when i am in this method, if the user is currently logged on the website or in Odoo?

Avatar
Discard