2014-02-06 7 views
0

고객 송장에 'Confirm'버튼이 생성되었습니다. '확인'버튼을 클릭하면 '상태 1'이 '확인'됩니다. 'state1'= 'draft'일 때 Validate 버튼을 숨기고 'state1'= 'confirmed'일 때 Validate 버튼을 보여주고 싶습니다. 코드 아래에서 시도했지만 작동하지 않습니다. 누구든지 나를 도울 수 있습니까?고객 송장 유효성 검사 버튼

<!-- inherit account invoice form --> 
    <record id="invoice_form_inheritai" model="ir.ui.view"> 
     <field name="name">account.invoice.form.inheritai</field> 
     <field name="model">account.invoice</field> 
     <field name="inherit_id" ref="account.invoice_form"/> 
     <field name="arch" type="xml"> 
      <button name="invoice_print" position="after"> 
       <field name="state1" invisible="1"/> 
       <button name="invoice_check" string="Confirm" type="object" attrs="{'invisible': [('state1','not in', ['draft'])]}" class="oe_highlight" groups="base.group_user"/> 
      </button> 
      <button name="invoice_open" position="replace"> 
       <button name="invoice_open" state="draft" string="Validate" attrs="{'invisible': [('state1','!=', ['confirmed'])]}" groups="base.group_user"/> 
      </button> 
     </field> 
    </record> 

답변

0

'상태'대신 '상태'를 사용해보세요. 심지어 attr도 필요하지 않습니다. 자동으로 작동합니다. 예는 :

<button name="invoice_open" states="confirmed" string="Validate" groups="base.group_user"/> 
+0

내가 말한대로 시도했지만 ... 여전히 유효성 검사 버튼을 표시하고 있습니다. 확인 버튼을 클릭하기 전까지 숨기고 싶습니다. '확인'버튼을 누르면 '상태 1'필드가 '확인 됨'으로 변경됩니다. – sajadkk

+0

oh den put states = "확인 됨". 내 대답도 편집했습니다. – Dharmraj

+0

잘 확인 단추가 숨겨져 있지만 '확인'단추를 클릭하면 표시되지 않습니다. 내가 워크 플로우를 바꿔야한다고 생각해. – sajadkk

1
<button name="invoice_open" string="Validate" attrs="{'invisible': [('state1','not in', ['confirmed']),('state','not in',['draft'])]}" groups="base.group_user"/> 

보이지 않는 속성과 상태를 모두 사용하지 않도록하십시오.