can't complete a move inventory when apply 1770

Description

when apply 1770, some case can't complete old "move inventory" document (maybe other inventory type)

I don't know exact how to make test data. i just can description condition.
1. make move inventory document, make status of it is not complete (in progress, error,...)
example this document have a line have id = 1004607

2. don't complete this move inventory document, but make a line M_MovementLineMA of this document line

3. apply 1770

4. complete this document, a error message display:
Require unique data: Please change information.: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "m_movementlinema_pkey" Detail: Key (m_movementline_id, m_attributesetinstance_id, datematerialpolicy)=(1004607, 0, 2014-07-14 00:00:00) already exists.

reason:
by add condition IsAutoGenerated='Y'. method MovementLineMA.deleteMovementLineMA don't delete old record of M_MovementLineMA (or even new record without IsAutoGenerated='Y')

Environment

None

Activity

Show:
Carlos Ruiz
July 22, 2014, 9:59 PM

so, if I'm understanding correctly this is a migration issue? can the solution be filling IsAutoGenerated in the migration script?

Hiep Lq
July 23, 2014, 4:23 AM

so, all record have IsAutoGenerated = 'Y'?
what's case IsAutoGenerated = 'N'.
it's maybe exists below case?
at a process, insert record with IsAutoGenerated = 'Y', at other process. need insert IsAutoGenerated = false?
, can you help me review this case, and make correct migrate script?

Deepak Pansheriya
July 30, 2014, 12:18 PM

Please find attached patch.

If you have already applied patch then use below script to update your existing system.

– Updating historical records
Update M_InOutLineMA set IsAutoGenerated = 'Y';

– Updating historical records
Update M_InventoryLineMA set IsAutoGenerated = 'Y';

– Updating historical records
Update M_MovementLineMA set IsAutoGenerated = 'Y';

Assignee

Deepak Pansheriya

Reporter

Hiep Lq

Labels

None

Tested By

None

Components

Affects versions

Priority

Blocker
Configure