Odooers论坛

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

How to update Product Type from consumable to tracked after a sale has already been completed

形象
odoo
1 备注
形象
丢弃
形象
odoo
-

i am encountering the same can someone reply please thanks


4 答案
0
形象
odoo
最佳答案

hello Etter 

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

形象
丢弃
0
形象
odoo
最佳答案

From database edit tables product template field type

形象
丢弃
0
形象
odoo
最佳答案

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".

2 注释
形象
丢弃
形象
odoo
-

kindly suggest the exact way to write the code.

形象
odoo
-

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.

0
形象
odoo
最佳答案

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

形象
丢弃