Odoo Help


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.


[v7] Lot Upstream and Downstream Traceability

on 6/8/15, 10:35 AM 1,244 views

By the definition that I found in documentation for openerp 6:

Upstream Traceability

It runs from the raw materials received from the supplier and follows the chain to the finished products delivered to customers. (Note that the name is confusing - this would often be considered a downstream direction. Think of it as Where Used.)

Downstream Traceability

It follows the product in the other direction, from customer to the different suppliers of raw material. (Note that the name is confusing - this would often be considered an upstream direction. Think of it as Where Supplied.)

In version 7 both buttons do the same thing and by looking at the code and can't see how could they do anything different.

def action_traceability(self, cr, uid, ids, context=None):
""" It traces the information of a product
@param self: The object pointer.
@param cr: A database cursor
@param uid: ID of the user currently logged in
@param ids: List of IDs selected
@param context: A standard dictionary
@return: A dictionary of values
lot_id = ids
if context is None:
context = {}
type1 = context.get('type', 'move_history_ids2')
field = context.get('field', 'tracking_id')
obj = self.pool.get('stock.move')
ids = obj.search(cr, uid, [(field, 'in',lot_id)])
cr.execute('select id from ir_ui_view where model=%s and field_parent=%s and type=%s', ('stock.move', type1, 'tree'))
view_ids = cr.fetchone()
view_id = view_ids and view_ids[0] or False
import pdb;pdb.set_trace()
value = {
'domain': "[('id','in',["+','.join(map(str, ids))+"])]",
'name': ((type1=='move_history_ids2') and _('Upstream Traceability')) or _('Downstream Traceability'),
'view_mode': 'tree',
'view_type': 'tree',
'res_model': 'stock.move',
'field_parent': type1,
'view_id': (view_id,'View'),
'type': 'ir.actions.act_window',
return value

Am I missing something or is it not working as it should be?

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)


Asked: 6/8/15, 10:35 AM
Seen: 1244 times
Last updated: 6/8/15, 10:36 AM