Ir al contenido
Menú
Se marcó esta pregunta
4 Respuestas
3023 Vistas

Hey Team

I'm just wondering if it is possible to update a product to track inventory after it has been previously sold as a consumable item.

We just done our stock take so we now have up-to-date numbers on all the items we have in stock.

But since we have already sold some of these products when we want to change a consumable product to a tracked product that comes up with the error that we cannot change it after a sale has been completed.

Invalid Operation

You can not change the inventory tracking of a product that was already used.

I assume the most tidy/simple method here is to duplicate the product and then archive the old one?


Thanks



Avatar
Descartar

i am encountering the same can someone reply please thanks


Mejor respuesta

hello Etter 

my suggestion is to Duplicate the Product Archive of the Old One and change the product type from Consumable to Storable Product.

Avatar
Descartar
Mejor respuesta

Hi

This is a process you can use to change product type. I got it from Thuy Ngoc, so all credits to him.

Step 1: Go to menu Settings => Technical => Actions => Server Actions.
Step 2: Create an action with the following information:
+ Name: Update product type
+ Model: Server Action
+ Action To Do: Execute Python Code
+ Python Code: env.cr.execute("""Update product_template set detailed_type = 'consu' where id = id_of_product_template """)
Step 3: Click Run

To get the ID of your product, make an export with that field. Replace "id_of_product_template" in the code with your specific number.

If you want the change product type to storable product, replace "consu" with "product".

Avatar
Descartar

kindly suggest the exact way to write the code.

Hi Nourhan
I think you didn't read my post well enough :)

Here is the code again:

env.cr.execute("""Update product_template set detailed_type = 'consu' where id = id_of_product_template """)

Replace "id_of_product_template" in the code with the ID of your specific product.

Mejor respuesta

hi Stefan,

the answer you received from Rakesh is good and easy.
I f you also need to sum the sell statistics, you can try to manage them by labels on that products. Another possibility is to export all data of consumabile item, and import them in the storable one, but export/import is always more complicated option

Avatar
Descartar
Mejor respuesta

From database edit tables product template field type

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
jun 25
1980
3
feb 25
4801
0
nov 24
966
2
nov 23
2487
7
jul 24
8218