İçereği Atla
Menü
Bu soru işaretlendi
2537 Görünümler

Hi everyone! I created a JS button located in the sale order line that call a python method and opens an action as a popup. 

The goal here is that the user can access to that button and do something, the very next moment it clicks on "Add a Line" on a Sale Order.

The issue I'm having is that inside the python method, the sale order line is not created yet and therefore anything I do afterwards is useless.

How can I make sure that when I click the JS button, my Sale Order Line get created before?


This is the event and the call of the js function:

events:_.extend({}, Widget.prototype.events,{'click':'_openBudgetSplit',}),
/**
* @private
* @param{MouseEvent}event
* @returns{Promise} action loaded
*/
async_openBudgetSplit(ev) {
    ev.stopPropagation();
    this.$el.find('.fa-percent').prop('special_click', true);
    var action = awaitthis._rpc({
        model:'sale.order.line',
        method:'action_show_budget_split',
        args: [[this.model.data.id], this.product_id, [this.product]]            });
    return this.do_action(action);


Thanks a lot in advance :)

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
2
May 22
13875
2
Nis 22
4045
1
Nis 22
3103
1
Tem 25
3189
10
Ara 24
30967