0
我正在嘗試爲自定義模塊定義一個設置視圖。設置視圖中的重複保存和取消按鈕
我按照雙方的官方文檔和博客,幫助你的代碼適應Odoo 10:
http://odoo-development.readthedocs.io/en/latest/dev/py/res.config.settings.html http://ludwiktrammer.github.io/odoo/custom-settings-odoo.html
目前,這是我的代碼顯示形式:
<record id="mymodule_configuration_form" model="ir.ui.view">
<field name="name">TEST Settings</field>
<field name="model">mymodule_settings</field>
<field name="arch" type="xml">
<form class="oe_form_configuration">
<header>
<button string="Save" type="object"
name="execute" class="oe_highlight"/>
<button string="Cancel" type="object"
name="cancel" class="oe_link"/>
</header>
<sheet>
<group>
<label for="color"/>
<field name="color"/>
</group>
</sheet>
</form>
</field>
</record>
這是菜單的代碼:
<menuitem id="mymodule_menu"
name="Custom Saleorder"
parent="base.menu_custom" />
<act_window id="mymodule_settings_action"
name="Custom Saleorder Settings Action"
res_model="mymodule_settings"
view_mode="form" />
<menuitem id="mymodule_settings_menu"
name="Settings"
action="mymodule_settings_action"
parent="mymodule_menu" />
雖然這樣做,我發現我已經複製按鈕,我如何刪除上述的?
我認爲,我對付它繼承res.config.settings模型中的事實是相關的。
你不需要添加保存和取消按鈕。 Odoo將追加本身。只需從標題部分刪除這些按鈕即可。然後再試一次。 – KbiR
我是這樣做的,但Odoo默認添加的按鈕不會保存/更新ir_config_param表。 –