0
고객을 저장할 때만 "편지 제공"단추를 표시하는 데 너무 많은 방법을 시도했습니다.고객이 저장 한 후에 만 머리글 단추를 표시하는 조건
모델 :
class res_partner(models.Model):
_inherit = 'res.partner'
baf = fields.Boolean("Application Form", help="Specify customer who bought application form")
@api.multi
def offer_letter_method(self):
return self.env['report'].get_action(self, 'sales_custom.offer_letter_view')
보기 : 친절
<record model="ir.ui.view" id="customer_custom_form_view">
<field name="name">customer.custom</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//form/*" position="before">
<header>
<button name="offer_letter" string="Offer Letter" type="object" class="oe_highlight"
attrs="{'invisible':[('what condition?')]}"/>
</header>
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field name="baf"/>
<label for="baf"/>
</xpath>
</field>
</record>
아래
<xpath expr="//form/*" position="before">
<header>
<button name="offer_letter" string="Offer Letter" type="object" class="oe_highlight"
attrs="{'invisible':[('what condition?')]}"/>
</header>
</xpath>
내 코드입니다 :하지만 내가 여기 상태를 받고 있지 않다 보인다 돕다.