Odoo Help


Update stored values of other form

on 11/20/14, 1:16 AM 532 views


i created my own module , which will add one2many field to product.product ,this one2many will have 'size' column .

now i created other one2many field in stock.move which has the same column 'size' , i want to subtract the stock.move.size with product.product.size (stock.move.size - product.product.size)

so from the stock.move form how can i update the value of 'size' which is on the product.product

Any help will be appreciated .




| 5 3 6
Jakarta, Indonesia
On 11/20/14, 1:26 AM

You have a couple of options.  One is to create a button that call a method to update the product.product's size field based on the current stock.move's data, or you can do it on the stock.move's write.

One quetion that pops into my head is, you'll be creating tens, hundreds, or thousands if not more, stock.move for that particular product, aren't you going to just make it very large negative number?  I have a hunch you mean to do something else, maybe if you can state what you intend to do, a better help can be offered.

sure , on creating new product I added a one2many field which contains the pieces of the product , the product quantity will be the summation of the size for all pieces . now from the delivery order 'stock.move' , I want to decrease the selected pieces values . let's take an example. on creating the product A : the sizes will be 50m ,25m now if we create a delivery order and we insert 25m,25m this sizes will be subtracted from the sizes stored once we create the product , now the available sizes is : 25m,0m. for fabric use ^_^ thanks to you

on 11/20/14, 1:32 AM

Moayad, I think you should look into stock.production.lot (now labelled Serial Number). That is a way for you to track the the quantity of a certain batch of product. It is already built into the stock logic. A stock.production.lot is tied to a product. You can always create a new stock.production.lot for every delivery order.

on 11/20/14, 3:11 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/20/14, 1:16 AM
Seen: 532 times
Last updated: 3/16/15, 8:10 AM