Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6304 Lượt xem

Hello!

I am looking to add a button to a view of product.template that would open the same product.template but into the front office shop.

I don't see how to achieve it.

I took a look how the "website" button in the back office header is done and I don't see how to apply it to a header of a view for instance.

Then I though about to hack website_sale controller, but no great idea how to achieve it also.

Did anyone already success to create a bridge between back office and front office?

 

Help is welcome.

Jordi

 

 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Jordi,
Have a look at the website_quote module from Odoo.

When installed, this module allows the creation of a  button to help you view the quotation online - this button brings you directly from the Back office to the Front office.

Maybe you can analyse the behaviour of this link and replicate it to your needs.
 

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Thanks Will,

I based my work on website_quote and worked fine.

return {
            'type': 'ir.actions.act_url',
            'target': 'self',
            'url': '/shop/product/%s' % slug(product_template)
}

The trick was to set the type to 'ir.action.act_url'

Regards,

Jordi

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 5 25
3095
0
thg 12 23
2696
1
thg 7 23
2771
0
thg 7 22
2161
3
thg 9 21
22934