【发布时间】:2021-03-30 19:25:24
【问题描述】:
我在模型“account.payment.register”中添加了一个字段(字符类型),
<field name="inherit_id" ref="account.view_account_payment_register_form"/>
<field name="arch" type="xml">
<xpath expr="//group/field[@name='communication']" position="after">
<field name="company" attrs="{'invisible': [('journal_type', '=', 'cash')], 'required': [('journal_type', '=', 'bank')]}"/>
</xpath>
</field>
</field>
我想根据这些条件在“公司”字段中添加默认值:
- 如果是“对外”付款,则 Company 必须获取当前公司。
- 如果是“入站”付款,公司会得到一个空白字段。 我可以用xml代码来做吗?请问有什么帮助吗? 谢谢。
【问题讨论】:
标签: javascript python xml odoo