[已解决]根据form数据 控制默认按钮(编辑/创建)
-
<record id="invoice_form_inherit" model="ir.ui.view">
<field name="name">invoice.form.inherit</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<xpath expt='//form[@string="Invoice"]' possition='attributes'>
<!-- Frist intent : nothing happened -->
<attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}"/>
<!-- Second intent : edit, always hide -->
<attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}">false</field>
<!-- Thirds intent : edit, never hide -->
<attribute name="edit" attrs="{'invisible:[('state','=','paid')]'}">true</field>
</field> -
attrs="{'invisible:[('state','=','paid')]'is not needed
-
@mrshelly py里面没法控制吧?
-
@mrshelly py里面没法控制吧?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login