【发布时间】:2021-03-05 04:08:11
【问题描述】:
n v14,我想通过选择发票以付款方式进行发票付款。在 v13 中,已经有 invoice_ids 字段,我将只读更改为 0,可以付款。但是在 v14 中,没有 invoice_ids 字段。所以我创建了这个,但我该怎么做呢?我分享我的一些代码
invoice_ids = fields.Many2many('account.move', 'account_invoice_payment_rel', 'payment_id', 'invoice_id', string="Invoices", copy=False,
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""")
我的看法是
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="1" 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/>
【问题讨论】:
-
你找到解决方案了吗?
-
@Bashir。我找到了解决方案
-
解决方案是什么?
-
@Bashir。我分享了我的代码。希望这对你有用。但是你需要为inoices id编写xml文件。
-
@Bashir。它对你有用吗?
标签: odoo accounting