In v14, I want to make invoices payment in payment form by choosing invoices. In v13, already have invoice_ids field and I changed to readonly to 0 and can make payment. But in v14, there is no invoice_ids field.So I create this but how can I do that?I share my some code
invoice_ids = fields.Many2many('account.move', 'account_invoice_payment_rel', 'payment_id', 'invoice_id', string="Invoices", copy=False, readonly=True,
help="""Technical field containing the invoice for which the payment has been generated.
This does not especially correspond to the invoices reconciled with the payment,
as it can have been generated first, and reconciled later""")
My view is
<record id="view_account_payment_form_inherit_payment" model="ir.ui.view">
<field name="name">view.account.payment.form.inherit.payment</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//group" position="after">
<group invisible="context.get('active_model') == 'account.move'">
<field name="invoice_ids" attrs="{'invisible': [('partner_id', '=', False)]}" readonly="0" domain="[('partner_id','child_of',partner_id),('state','=','posted'),('payment_state','=','not_paid')]" >
<tree>
<field name="partner_id"/>
<field name="name"/>
<field name="amount_residual"/>
<field name="state"/>
</tree>
</field>
</group>
</xpath>
</field>
</record>