Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7013 Vizualizări

Greetings,

I'm trying to modify onhand quantity from product.template view , i added fields which the summation of them should be stored on the onhand quantity avilable field , it should be automated so every thing is fine with me but i can't update the avilable quantity which is on the ' stock_change_product_qty ' view .

 

so how i can do it .

 

Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

Moayad, On Hand Available quantity is a calculated field.  To change the quantity on hand, you need to create stock.move.  Inventory Stock model is a way to allow you to create a stock.move that makes the quantity to be the figure you specify.  The stock_change_product_qty is the wizard that you can use to create Inventory Stock (see the method change_product_qty of that model) for a particular product.

So, if you have a couple of fields added to specify the quantity on hand in the product.product model, one way you can actually change the quantity on hand is by triggering stock_change_product_qty (update link) and set the new_quantity field of that model to be the figure that you want.  To do so, you can explore the default_get method of ORM.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 16
6854
1
aug. 19
2808
1
sept. 17
9495
0
nov. 15
3215
1
oct. 15
5222