Odoo Help

0

[ODOO 11] Is there anyway to call a wizard/view in the portal/website?

By
Maria Carla
on 5/16/18, 9:03 AM 75 views

I've implemented a wizard to edit an attribute for multiple objects at the same time. I would like to make this feature available for my clients, but, I dont want them accessing the apps, only the website/portal. Is there anyway to call this wizard and view on the portal or the only way to do this is by implementing a new feature using HTML?

0
jithesh
On 5/17/18, 3:41 AM

Hi, Maria

yes there is a way

js,py,controller,xml

this is the basic idea to popup wizard

odoo.define('website_sale_quote.webaccount', function(require) {
"use strict";

var ajax = require('web.ajax');
require('web.dom_ready');
//var Model = require('web.DataModel');
var weContext = require("web_editor.context");
require('portal.portal');
var websui = require('portal.portal');

$('.o_portal #quote_request').click(function(event){
var $form = $(this).closest('div');
console.log(this);
event.preventDefault();
ajax.jsonRpc("/my/temps", 'call', {
'product_id': 'jitheshk',
}).then(function (modals) {
////your events you want to process//////////

controller part///////////////////
@http.route(['/my/temps'],type='json', auth="public", methods=['POST'], website=True)
def quote_requests(self, product_id):
print("hai");
print(product_id);
return request.env['ir.ui.view'].render_template("website_sale_quote.temp",{
'Quot':product_id,
})
xml part/////////////////////////////

<template id="temp" name="Optional Productss">
<div id="modal_optional_products" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h4 class="modal-title" id="myModalLabel">Quote Request</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-condensed">
<thead>
<tr>
<th><t t-esc="Quot"/></th>
<!--<th></th>-->
<!--<th class="text-center td-qty">Details</th>-->
<!--<th class="text-center td-price">Price</th>-->
</tr>
</thead>
<tbody>    
           

</tbody>
</table>
</div>
<div class="modal-footer">
<a class="btn btn-default a-submit js_goto_shop"><i class="fa fa-chevron-left"></i> <span class="hidden-xs">Cancel</span><span class="visible-xs-inline">Continue</span></a>
<a class="btn btn-primary pull-right a-submit"><i class="fa fa-shopping-cart fa-fw"></i> <span class="hidden-xs">Submit Now</span><span class="visible-xs-inline">Checkout</span></a>
</div>
</div>
</div>
</div>
</template>
0
--Hilar AK--
  Blog:-
        https://hilarlive.wordpress.com/
  StackOverflow:
        http://stackoverflow.com/users/7561347/burmese-pythis

Qoura:
    

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



Hilar AK
On 5/16/18, 10:22 AM

Either you can use the bootstrap modals or you can call existing view by restricting and adding more securities on odoo view. like the portal access.

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

Question tools

1 follower(s)

Stats

Asked: 5/16/18, 9:03 AM
Seen: 75 times
Last updated: 5/17/18, 3:41 AM