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

Rubén A. Estrada Orozco rulotec1 at gmail.com
Wed Apr 27 17:14:08 GMT 2022


Wow, I didn't know that you could do that in 5.4 either... and to be honest
it does sound like a not very useful feature.

To get around it, I think the client should just set the SO in a "canceled"
status and then create a new one from the quote they want.

Having said that, I created an extension to load line items into quotes.
Basically, you copy-paste a list of quantities and codes into a field and
load the line items using an ajax request and some jquery. What you are
looking to achieve sound pretty similar to what this does:

[image: line_items_loader.gif]

You would just need to add an eventlistener to the "Quote" field in SO and
call an action that  gets you the quote's information. Then load the line
items into the line items table using jquery (this last part is exactly
what I do in my extension).

Let me know if you have further questions or would like me to cooperate in
some way

Saludos

Rubén


On Tue, Apr 26, 2022 at 3:57 AM Alan Lord <alanslists at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20220427/01629e87/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: line_items_loader.gif
Type: image/gif
Size: 255923 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20220427/01629e87/attachment-0001.gif>


More information about the vtigercrm-developers mailing list