Skip to Content
0
Former Member
Jun 04, 2018 at 12:40 PM

cannot assign partOf item [....] since it already belongs to

962 Views

Hello,

I have to change the owner of an Model. The Entry is own by the OrderModel X, and I need to attached it at the order Y.

Is it possible to do that? I tried this :

 entry.setOwner(newCart);
 entry.setOrder(newCart);

but once i do th esave, I have this error :

 cannot assign partOf item AbstractOrderEntry(\n\tcalc=true\n\tproduct=Product 'XXXXX' (8812182241281)\n\tinfo=product \"XXXXX\" with name \"n/a\"\n\tqtd=1\n\tunit=Unit 'pieces' type 'pieces' (8796093054986)\n\tbp=2.79\n\ttotal=2.79\n\ttaxes=[<TV<fr-vat-full#20.0#false#0.46#EUR>VT>]\n\tdiscounts=[]\n) to 88329001(11063704223787) since it already belongs to 88328000(11063671423019)",
             "type": "ModelSavingError

Do you have any tips to change the owner?

Thanks in advance, Jérémy.