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

stock.move auto_validate usage?

By
mike
on 9/26/13, 3:55 PM 1,657 views

I am not sure I understand what the use of auto_validate field is in stock.move. The only place I find it used is in stock.move.action_done()

        # Downstream move should only be triggered if this move is the last pending upstream move
        other_upstream_move_ids = self.search(cr, uid, [('id','!=',move.id),('state','not in',['done','cancel']),
                                    ('move_dest_id','=',move.move_dest_id.id)], context=context)
        if not other_upstream_move_ids:
            self.write(cr, uid, [move.id], {'move_history_ids': [(4, move.move_dest_id.id)]})
            if move.move_dest_id.state in ('waiting', 'confirmed'):
                self.force_assign(cr, uid, [move.move_dest_id.id], context=context)
                if move.move_dest_id.picking_id:
                    wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
                if move.move_dest_id.auto_validate:
                    self.action_done(cr, uid, [move.move_dest_id.id], context=context)

I'm fuzzy on what happens here. Does anybody know what the condition is that sets the auto_validate field to True?

0

AJ Schrafel Paper Corp

--AJ Schrafel Paper Corp--
2050
| 4 5 8
Bronx, United States
--AJ Schrafel Paper Corp--

Exploring OpenERP for business

AJ Schrafel Paper Corp
On 9/26/13, 4:22 PM

move_dest_id is another stock.move

You can see the definition of auto_validate in the columns section of stock.move. 'auto_validate': fields.boolean('Auto Validate'),

it is referenced in /procurement/procurement.py - action_confirm(): and /mrp/stock.py - _action_explode()

it makes it unnecessary for the user to manually validate the stock move that is generated by a process.

So if I had moves generated from CSV import or the scheduler would this manual validation step be added then? I'm interested to know the condition that sets this because I am adding a custom module to audit shipments and it might be useful to incorporate auto_validate into this but I don't want to interfere with its normal operation.

mike
on 9/27/13, 10:32 AM

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

0 follower(s)

Stats

Asked: 9/26/13, 3:55 PM
Seen: 1657 times
Last updated: 3/16/15, 8:10 AM