2017-08-16 31 views
0

在Odoo 10我有Python的模型像如何從Odoo的js代碼中的Python模型中調用一些數據?

class SubprogramPassport(models.AbstractModel): 
_name = "energy.saving.program.subprogram.passport" 

我也有觀點這一個,我定義我的js代碼裏面的文件和「腳本」標籤。 如何從js代碼中的Python模型調用一些數據?

+0

你能告訴你的js代碼相同的行,要加載的數據? – qvpham

回答

0

這是用Python調用模型的例子JS

var model = new Model('custom.model'); 
    model.call('custom_functions', 
    [{ 
    active_id: this.selected_event_id || '',//example params 
    filter: pyeval.sync_eval_domains_and_contexts({ 
      domains: search.domains, 
      contexts: search.contexts, 
      group_by_seq: search.groupbys || [], 
     }), 
    }]) 
相關問題