[Vtigercrm-developers] Recreating feature from vtiger 5.4.0 in 7.4.0 for Inventory records?

Alan Lord alanslists at gmail.com
Tue Apr 26 08:53:11 GMT 2022


Interesting request from a customer...

We've recently upgraded them from 5.4.0 to 7.4.0.

They explained something that I never knew happened in 5.4.0, but they 
would like it happen in 7.4.0 too.

If you have a Sales Order, and in vtiger 5.4.0 you change the related 
quote in the quote_id field and save it (recall you could only edit 
reference fields in EditView in 5.4.0), it replaces most of the related 
data in the Sales Order, including LineItems, as if you had used the 
"Generate Sales Order" button from within the Quote.

See the EditView script in vtiger 5.4.0 in SalesOrders for example. 
There is a line:

> if (isset ($_REQUEST['convertmode']) && $_REQUEST['convertmode'] == 'update_quote_val') {

This basically replaces all the line item data from the new quote_id 
wiping what was in this Sales Order before.

I can see why this shouldn't really be allowed to happen to be honest 
but the customer would like me to re-implement this feature. as they 
used it a lot in their old system.

But I am struggling to find a suitable method in the Inventory or Vtiger 
classes which will allow me to "load" lineItem data directly into the 
Record model during the save operation? From what I can see, what 
happens currently is that the LineItem data is taken from the DOM when 
you do a save and there doesn't seem to be a mechanism to achieve what I 
want without having to get rather complicated and reload the screen once 
or twice and then force a save event. This is pretty messy when using an 
Ajax save for example.

I doubt this makes much sense but maybe writing out this issue will help 
me think it through a bit more...

al




More information about the vtigercrm-developers mailing list