如何在Odoo13中获得交易参考

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

在Odoo11中,我可以通过这种方式获得交易参考

transaction = request.website.sale_get_order().payment_tx_id
transaction.reference

但是在Odoo13中,payment_tx_id字段已从销售订单中删除,

odoo odoo-11 odoo-13
1个回答
1
投票
字段

Many2one(payment_tx_id)到Many2many(transaction_ids)类型从Odoo12更改。

尝试以下代码:

order = request.website.sale_get_order() #if you need to get last transaction transaction = order.get_portal_last_transaction() reference = transaction.reference #if you need all reference to listed reference = str(', '.join(order.transaction_ids.mapped('reference')))

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