Odoo Help

Welcome!

This community 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.

0

which method use odoo to create new stock move

By
Zouhair
on 8/19/14, 11:09 AM 4,157 views

hi,

which method is responsible to create new Traceability Stock Moves, in Warehouse module?

thx in advance.

Do you mean in stock_move?

klacus
on 8/19/14, 11:47 AM

yes, which method i have to use to create new stock moves, i want the method name to call it from other languge. thx

Zouhair
on 8/19/14, 12:30 PM

with create method, pls. see the answer.

klacus
on 8/19/14, 2:26 PM
1
klacus
On 8/19/14, 2:25 PM

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.

Zouhair
on 8/20/14, 4:35 AM

Hello. I refresh the answer. B.R. L.

klacus
on 8/20/14, 4:49 AM

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.

Zouhair
on 8/21/14, 2:59 AM
Hi.

How you call the method?

May you need to be an taking over the object.
NoneType mean the system waiting for you a stock.move object but you didn't send it as well.

B.R.
L.

2014-08-21 08:59 keltezéssel, Zouhair írta:
<blockquote cite="mid:1408604388.288727998733521.471868156004345-openerp-60594-forum.post@accounts.odoo.com" type="cite">

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.

--
Zouhair Sent by OpenERP S.A. using Odoo. about Forum Post False
klacus
on 8/21/14, 3:02 AM
0
Zouhair
On 8/21/14, 8:25 PM

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

klacus
on 8/21/14, 8:33 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 8/19/14, 11:09 AM
Seen: 4157 times
Last updated: 3/16/15, 8:10 AM