Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
131 Vistas


I'm using odoo.sh version 18

We are facing an issue in the Purchase module.

When selecting product in purchase order lines in any RFQ created from approval module PR, the same product is automatically duplicated around 6 times in separate lines — even though it was chosen only once.

The product has one vendor, no variants, and no custom automation or Studio behavior.

when removing the duplicated lines we are not able to save the RFQ as an error pops up indicating there is an invalid value entered in an integer field.
eventually we can not add the correct order lines and can not save and proceed with the RFQ, also unable to identify the source issue from the errors and cant find an explanation of this unexpected behavior in the order lines.

Please advise, thank you in advance.


Avatar
Descartar

Do you have ms_purchase_sequence installed?

Try removingit in a staging branch to see if it is causing the problem.

Mejor respuesta

Hi,


The issue of duplicated products in purchase order lines when creating RFQs from the Purchase Request or Approval module in Odoo 18 usually stems from a conflict or error in how Odoo copies request lines into the purchase order. When the duplication occurs only on RFQs generated through requests and not on manually created POs, it indicates that the problem lies in the request-to-RFQ linkage — typically due to the _prepare_purchase_order_line method being triggered multiple times or a module override that duplicates the creation process.


The “invalid integer field” error that appears when you delete the duplicate lines happens because those lines are linked to a missing or invalid purchase request line ID. When you remove them, Odoo tries to set a required relational field to null, causing the constraint error. Checking in Developer Mode will reveal if the field purchase_request_line_id or approval_request_line_id is involved.


To fix the issue, review installed modules and custom code, especially anything inheriting from purchase_request_to_rfq or similar. You may need to patch the logic to prevent duplicate line creation or disable automated actions that might trigger extra entries. As a temporary workaround, manually recreate the RFQ, remove duplicates before saving, or export and reimport the valid lines. In summary, the problem is caused by duplicate triggers or broken foreign key links between the Purchase Request and RFQ lines, which can be resolved by reviewing custom module logic or disabling overlapping automation.


Hope it helps

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
nov 25
23
3
sept 25
1056
3
ago 25
1522
1
jul 25
1364
1
jul 25
1689