我如何设置Odoo 13中所需的invoice_payment_term_id?

问题描述 投票:0回答:1

我正在尝试根据需要设置invoice_payment_term_id字段。通常只需添加required =“ 1”应该可以,但不能在这里使用:

                            <!-- Invoice payment terms (only invoices) + due date (only invoices / receipts) -->
                            <label for="invoice_payment_term_id" attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>
                            <div class="d-flex" attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}">
                                <field name="invoice_payment_term_id" placeholder="Terms" attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>
                                <span class="o_form_label mx-3 oe_edit_only" attrs="{'invisible': [ '|', '|', '|', ('state', '!=', 'draft'), ('invoice_payment_term_id', '!=', False), ('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"> or </span>
                                <field name="invoice_date_due" force_save="1" placeholder="Date" attrs="{'invisible': ['|', ('invoice_payment_term_id', '!=', False), ('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>
                            </div>

我尝试过:<field name="invoice_payment_term_id" placeholder="Terms" required="1" attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}"/>

<field name="invoice_payment_term_id" placeholder="Terms" attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))], 'required': [('type', 'not in', 'in_refund')]}"/>

html required qwebview odoo-13
1个回答
0
投票

请确保大多数情况下是在表单视图上执行的,这是在您继承错误的视图时发生的>]

© www.soinside.com 2019 - 2024. All rights reserved.