[Fix] stock: Fix the Upstream and Downstream Traceability

bzr revid: sbh@tinyerp.com-20100906110934-7ocdzgwrgta3yxpd
This commit is contained in:
sbh (Open ERP)
2010-09-06 16:39:34 +05:30
parent 2b31b2471a
commit 093ca431b3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -163,7 +163,7 @@
<field name="active" select="1"/>
<separator string="" colspan="4" />
<group col="4" colspan="4">
<button name="action_traceability" icon="gtk-go-back" string="Downstream traceability" type="object" context="{'type': 'move_history_ids2','field': ''}"/>
<button name="action_traceability" icon="gtk-go-back" string="Downstream traceability" type="object" context="{'type': 'move_history_ids','field': ''}"/>
<button name="action_traceability" icon="gtk-jump-to" string="Upstream traceability" type="object" context="{'type': '','field': ''}"/>
</group>
</form>
@@ -255,7 +255,7 @@
<field colspan="4" name="revisions" nolabel="1"/>
<group col="4" colspan="4">
<button name="action_traceability" string="Upstream Traceability" type="object" context="{'type': '', 'field': 'prodlot_id'}" icon="gtk-go-back"/>
<button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids2', 'field': 'prodlot_id'}" icon="gtk-jump-to"/>
<button name="action_traceability" string="Downstream Traceability" type="object" context="{'type': 'move_history_ids', 'field': 'prodlot_id'}" icon="gtk-jump-to"/>
</group>
</page>
</notebook>
+2 -2
View File
@@ -39,7 +39,7 @@ class action_traceability(osv.osv_memory):
@return: A dictionary of values
"""
type1 = context['type'] or 'move_history_ids'
type1 = context['type'] or 'move_history_ids2'
field = context['field'] or 'tracking_id'
obj = self.pool.get('stock.move')
ids = obj.search(cr, uid, [(field, 'in',context['active_ids'])])
@@ -47,7 +47,7 @@ class action_traceability(osv.osv_memory):
view_id = cr.fetchone()[0]
value = {
'domain': "[('id','in',["+','.join(map(str, ids))+"])]",
'name': ((type1=='move_history_ids') and 'Donwstream Traceability') or 'Upstream Traceability',
'name': ((type1=='move_history_ids2') and 'Upstream Traceability') or 'Downstream Traceability',
'view_type': 'tree',
'res_model': 'stock.move',
'field_parent': type1,