msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
GNU Affero General Public License v3.0
17 stars 11 forks source link

Post migration from desktop, previous 'sg' stocktakes have missing lines #3910

Open nisha-dangol opened 2 weeks ago

nisha-dangol commented 2 weeks ago

What went wrong? 😲

Post migration from desktop, previous `sg` stocktakes have missing lines ## Expected behaviour 🤔 The lines should appear as well ## How to Reproduce 🔨 Steps to reproduce the behaviour: 1. First on mSupply-OG remote-site, create two stocktakes: one `fn` and one `sg` with some lines and sync 2. Then convert to oms by resetting hardware ID & all 3. Reinitialise the new oms-site from scratch 4. In oms, the `fn` stocktakes appear with lines properly 5. Also revisit the `sg` stocktake 6. See error: The `sg` stocktake has no line at all. ## Your environment 🌱
roxy-dao commented 2 weeks ago

@nisha-dangol What type is the items? The stocktake lines can be missing because it's a type we don't handle

nisha-dangol commented 2 weeks ago

@nisha-dangol What type is the items? The stocktake lines can be missing because it's a type we don't handle

They were normal stock items. Rest assured, I used the same items in both sg and fn stocktakes. Problem is only for sg ones.

roxy-dao commented 2 weeks ago

I can't seem to reproduce it with my datafile. Can you upload yours to the drive?

nisha-dangol commented 2 weeks ago

I can't seem to reproduce it with my datafile. Can you upload yours to the drive?

Here's the link to oms datafile: https://drive.google.com/file/d/1f9kWAOO3suQsRlrq3-nvl_GobfLQH5wK/view?usp=drive_link

roxy-dao commented 1 week ago

Sorry can I get the mSupply datafile? The item being used in the stocktake line is missing from the sqlite database, and I'm unsure why without seeing how it looks on mSupply

nisha-dangol commented 1 week ago

Sorry can I get the mSupply datafile? The item being used in the stocktake line is missing from the sqlite database, and I'm unsure why without seeing how it looks on mSupply

Oh it's there on the same folder: #3910

roxy-dao commented 1 week ago

Are you sure this isn't just bad data? I checked both databases in OMS and OG and can't find the stock_line (item_line) for the item in the stocktake line

nisha-dangol commented 1 week ago

I checked both databases in OMS and OG and can't find the stock_line (item_line) for the item in the stocktake line

There's item_line in the stocktake in the OG, which after converted/migrated to OMS now that item_line disappears in that same sg stocktake.
Are you sure this isn't just bad data?

I can try and replicate with a fresh/new datafile as well then will update you

roxy-dao commented 1 week ago

I checked both databases in OMS and OG and can't find the stock_line (item_line) for the item in the stocktake line

There's item_line in the stocktake in the OG, which after converted/migrated to OMS now that item_line disappears in that same sg stocktake.

Are you sure this isn't just bad data?

I can try and replicate with a fresh/new datafile as well then will update you

I checked the record browser and the item_line isn't there

nisha-dangol commented 1 week ago

I checked the record browser and the item_line isn't there

Not sure about the item_line field in record-browser>stocktake table, I'm referring to actual item lines in the stocktake.

I also created a new site & store again and the error still persists. I've also uploaded the video-recording of the whole process to the #3910-folder; the OG has the item lines in the stocktake, and after migration to oms, those item-lines are missing from the stocktake FYI, for this recording, the mSupply is in v7-14-06 and for oms, I used v2.0.2 server exe.

Extra note: why is oms v2.0.2 showing version as v2.1.0?

roxy-dao commented 1 week ago

Okay~ found out what's happening. In mSupply, the new stock line doesn't get created until the stocktake is finalised, but in Open mSupply it gets created when the new line is added to stocktake since stock_line is a foreign constraint in stocktake_line. Will need discussion on how to solve this issue.