Pythonには、次のフィールドがあります。
'permit':fields.selection([('new', 'New'),
('applied', 'Applied'),
('received','Received')], 'Permit', select=True),
def apply_permit(self, cr, uid, ids, context=None):
data = {'value': {'permit':'applied'}}
return data
XMLには、次のものがあります。
<field name="permit" readonly="True"/>
<button name="apply_permit" string="Apply" type="action" class="oe_highlight" attrs="{'invisible':[('permit','=','applied')]}" />
上記の属性コードは現在機能しませんが、やりたいことは次のとおりです。ボタンをクリックすると、「許可」フィールドの値が「適用」に設定され、ボタンが非表示になります。これらはすべて、フォームを保存する前に行われます。ボタンはフォーム内にあります。