Ir al contenido
Menú
Se marcó esta pregunta

I have created a custom menu item in order to display a summarized dashboard for the inventory and logistic movements. 

logistics_dashboardfield>logistics_dashboard_tagfield>record>


menuitem>


in the action here, there is a custom javascript code with a custom method created on 'stock.quant'  model to load necessary information.


odoo.define('smarten_logistics.logistics_dashboard', 

function(require)

{

"use strict";
varAbstractAction=require('web.AbstractAction');

varcore=require('web.core');

varQweb =core.qweb;

varrpc=require('web.rpc');

varajax=require('web.ajax');
varLogisticsDashboard = AbstractAction.extend({template:'logistics_dashboard',
init:function(parent,context)

{this._super(parent,context);this.dashboard_templates=['Items'];this.today_sale=[]; },


start:function()

{varself=this;this.set("title",'Dashboard');returnthis._super().then(function(){self.render_dashboards(); }); },


render_dashboards:function()

{varself =this;_.each(this.dashboard_templates,function(template){self.$('.o_logistics_dashboard').append(Qweb.render(template,{widget:self})); }); },


willStart:function(){varself=this;return$.when(ajax.loadLibs(this),this._super()).then(function(){returnself.fetch_data(); }); }, 


fetch_data:function(){varself=this;vardef1=this._rpc({model:'stock.quant',method:'get_all_items_in_stock',
}).then(function(result){self.total_items=result['quant_response'];self.todays_move=result['todays_move'];self.num_moves_today=result['num_moves_today'];self.total_items_received=result['total_items_received'];self.total_items_dispatched=result['total_items_dispatched'];self.total_technician_stock=result['total_technician_stock']/
});return$.when(def1);
},});


core.action_registry.add('logistics_dashboard_tag',LogisticsDashboard);
returnLogisticsDashboard;
});

////////////////////////////////////////////////////////////////////////////////////////////


the data is displayed from an xml file. Now what I want to do is the dashboard is the summarized view of the logistic movements. When the user clicks on a button on that page, i want to redirect to the transfers page, showing all the transfers made along with some default filters applied and group by functions enabled. How do i do that?


I could just set the href to the url directly but by doing that i cannot set the filter and group by parameters. 

What is exactly needed to do here so i can achieve that? 

shall i create a controller and pass the domain there, if yes can you explain me exactly what i should do?


In short: I want to open the stock.picking list view with some filters and group by options by default when i click on a button that i created on an xml page.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 23
1424
3
mar 25
987
1
oct 24
5320
3
dic 23
4688
2
mar 23
2407