Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged

Problem Description

When closing a POS session in Odoo 17 Community, I consistently encounter a foreign key constraint violation error on the account_bank_statement_line table. The system attempts to insert rows using payment record IDs as partner IDs.

Error Message

ERROR: An insert or update on table "account_bank_statement_line" violates the foreign key

constraint "account_bank_statement_line_partner_id_fkey"

DETAIL: Key (partner_id)=(211) is not present in table "res_partner".


Problematic SQL Query


INSERT INTO "account_bank_statement_line"

("amount", "create_date", "create_uid", "move_id", "partner_id", "payment_ref", "sequence", "write_date", "write_uid")

VALUES

(50.0, '2025-03-17 11:46:13.066248', 2, 2050, 213, 'Payment: 50.0', 1, '2025-03-17 11:46:13.066248', 2),

(246.96, '2025-03-17 11:46:13.066248', 2, 2051, 212, 'Payment: 246.96', 1, '2025-03-17 11:46:13.066248', 2),

(99.96, '2025-03-17 11:46:13.066248', 2, 2052, 211, 'Payment: 99.96', 1, '2025-03-17 11:46:13.066248', 2),

(246.96, '2025-03-17 11:46:13.066248', 2, 2053, 206, 'Payment: 246.96', 1, '2025-03-17 11:46:13.066248', 2)

RETURNING "id"


Problem Analysis

I discovered that the partner_id values (213, 212, 211, 206) in this query exactly match the record IDs in the pos_payment table associated with this POS session.


Expected Behavior

The system should use the partner_id from the associated POS orders (pos_order.partner_id) or NULL if no partner is specified, not the payment record IDs.

Environment

  • Odoo version: 17.0 Community
  • Installation type: On premise
  • Operating system: Linux

Question

Is this a known bug in Odoo 17 Community? Is there a solution or patch available?

Thank you for your help.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 25
1089
1
srp 24
1115
0
čvn 24
1050
3
čvn 24
1940
1
lis 22
2377