This question has been flagged

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?

Avatar
Discard
Best Answer

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>
Avatar
Discard

Hello jithesh
How to get a value many2one in popup wizard?

Here my controller
@http.route(['''/event/<model("event.event"):event>/registration/new'''], type='http', auth="public", website=True, sitemap=False)
# @http.route(['''/event/<model("event.event"):event>/registration/new'''], type='http', auth="public", website=True, sitemap=False)
def event_registration(self, **kw):
institusi_rec = http.request.env['res.partner.institusi'].sudo().search([])
values = {'institusi_rec': institusi_rec
}
return http.request.render("website_event_ylc.registration_attendee_details", values)

but the value many2one still not showing, looks like the problem is with http.route, but I don't have any idea because popup wizard display doesn't have url

Best Answer

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.

Avatar
Discard