2017-06-19 106 views
0

我試圖在Odoo sass-14中創建一個簡單地保存記錄的按鈕。我不希望按鈕做任何事情,只是保存記錄。如果我實現的按鈕是這樣的:Odoo表單按鈕保存記錄

<button string="Save" class="btn-primary"/> 

該記錄保存,但我在這說,UI得到一個錯誤:

https://my-server.odoo.com/web/content/513-eca963c/web.assets_backend.js:2303 
Traceback: 
TypeError: Cannot read property 'fail' of undefined 
    at Class.on_confirmed (https://my-server.odoo.com/web/content/513-eca963c/web.assets_backend.js:2303:919) 
    at exec_action (https://my-server.odoo.com/web/content/513-eca963c/web.assets_backend.js:2303:522) 
    at https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:547:681 
    at fire (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:541:299) 
    at Object.fireWith [as resolveWith] (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:546:198) 
    at https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:547:874 
    at fire (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:541:299) 
    at Object.fireWith [as resolveWith] (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:546:198) 
    at deferred.(anonymous function) (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:548:56) 
    at fire (https://my-server.odoo.com/web/content/490-ff226a6/web.assets_common.js:541:299) 

是否有可能創建一個按鈕,只需保存記錄?

回答

0

你可以試試這個按鈕嗎?

<button type="object" name="write" string="Save" class="btn-primary"/> 

讓我知道,如果它的工作原理。

+0

我想技術上可行,但我不喜歡這個解決方案,因爲它仍然要求一個額外的方法。點擊任何按鈕會自動保存記錄。點擊您顯示的按鈕意味着它已保存,然後再次寫入。我寧願點擊按鈕,保存記錄,然後不做任何事情。那可能嗎? – flyingL123