hi,
which method is responsible to create new Traceability Stock Moves, in Warehouse module?
thx in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
hi,
which method is responsible to create new Traceability Stock Moves, in Warehouse module?
thx in advance.
Hi.
under python:
self.pool.get('stock.move').create(cr,uid,vals, context=context)
you can find the atributes here:
https://doc.odoo.com/6.0/developer/2_5_Objects_Fields_Methods/methods/
Fot he complett movement you need to create a picking first. the stock move is many2one relation with the stock.picking object.
So first you need to create a stock picking with create. Secound you need to create a stock.move object where the picking_id is the created picking. (Please be note the return value of the create the created record id, so u need to insert the stock_move vals this id as picking_id)
Now I cannot go more deep, but please check the postgresql tables >> stock_move and stock_picking as well, and the linked document also.
Hope this Help.
Bye L.
post. m.
what is the error message?
Can you try this?:
def new_move(self, cr, uid, vals, context = None):
id = self.pool.get('stock.move').create(cr, uid, vals, context=context)
for move in self.pool.get('stock.move').browse(cr,uid,[id],context=context):
move..action_done(cr, uid, ids, context=context)return true
that only create new move, can you help me how to process it. thank you Klacus.
Hello. I refresh the answer. B.R. L.
thank you Klacus, but the class picking is for creating a new Delivery Orders and process it, my case is create a new Traceability stock move and process it, i can create a new move by calling that method self.pool.get('stock.move').create(cr,uid,vals, context=context), but for process my move with action_done method, i get an error: AttributeError: 'NoneType' object has no attribute 'state' can you help me. thx.
thank you Klacus, but the class picking is for creating a new Delivery Orders and process it, my case is create a new Traceability stock move and process it, i can create a new move by calling that method self.pool.get('stock.move').create(cr,uid,vals, context=context), but for process my move with action_done method, i get an error: AttributeError: 'NoneType' object has no attribute 'state' can you help me. thx.
--the call of the method:
def new_move(self, cr, uid, vals, context = None):
id = self.pool.get('stock.move').create(cr, uid, vals, context=context)
process_move(self, cr, uid, ids, context=context):
def process_move(self, cr, uid, ids, context=None):
return self.pool.get('stock.move').action_done(cr, uid, ids, context=context)
I refresh my prev. answer
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 7 17
|
6016 | ||
|
2
thg 7 17
|
9271 | ||
|
1
thg 3 17
|
6071 | ||
|
2
thg 4 15
|
8216 | ||
|
3
thg 4 15
|
5714 |
Do you mean in stock_move?
yes, which method i have to use to create new stock moves, i want the method name to call it from other languge. thx
with create method, pls. see the answer.