From 1736850a5a4d8efea876cc2765211e3d15a3cd1f Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Thu, 13 Jun 2024 09:22:19 +0200 Subject: [PATCH] [FIX] partner_invoicing_mode_cash_on_delivery: Avoid relation table collisions --- .../models/stock_picking.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py b/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py index 55c6b08a1ca..6495647162a 100644 --- a/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py +++ b/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py @@ -10,7 +10,14 @@ class StockPicking(models.Model): _inherit = "stock.picking" cash_on_delivery_invoice_ids = fields.Many2many( - "account.move", string="COD Invoices", copy=False, readonly=True + comodel_name="account.move", + # Force the table relation to avoid naming collisions + relation="stock_picking_cash_on_delivery_move_id_rel", + column1="picking_id", + column2="move_id", + string="COD Invoices", + copy=False, + readonly=True, ) def _invoice_at_shipping(self):