openerp 7 - show product category in stock move tree in openerp7 -
How can I show the category in the Share Move tree? This is my coding.
My view file.
& lt; Record id = "rufaf_stock_mov_tree_view" model = "ir.ui.view" & gt; & Lt; Field Name = "Name" & gt; Stock.mov.t tree & lt; / Field & gt; & Lt; Field Name = "Model" & gt; Stock.mov & lt; / Field & gt; & Lt; Area name = "inherit_id" ref = "stock.view_move_tree" /> & Lt; Field name = "arch" type = "xml" & gt; & Lt; Xpath expr = "// field [@ name = 'product_id']" position = "before" & gt; & Lt; Field name = "categ_id" group = "base.group_user" /> & Lt; / Xpath & gt; & Lt; / Region & gt; & Lt; / Record & gt;
My .py file
class custom_stock_move_tree (osv.osv_memory): _columns = {'categ_id': fields.related ('product_id', 'categ_id
Any help is appreciated.
your .py file
code> category custom_stock_move_tree (osv .model): #their different b / w osv.model and use it before using osv.osv_memory have read it _inherit = 'stock.move' # If you want to add data to the existing module, use heir _columns = {' Categ_id ': fields.related (' product_id ',' categ_id ', type =' many2one ', relation =' pro Duct.category ', store = true, string =' product category ')}}
Your view.xml file
& Lt; record id = "hallfied_stock_mov_tree_view" model = "ir ui.view" & gt; field name = "name" & gt; stock.mov.t tree & lt; / field & gt; & lt; Field Name = "Model" & gt; Stock.mov & lt; / Field & gt; & Lt; Area name = "inherit_id" ref = "stock.view_move_tree" /> & Lt; Field name = "arch" type = "xml" & gt; & Lt; Xpath expr = "// field [@ name = 'product_id']" position = "before" & gt; & Lt; Field name = "categ_id" group = "base.group_user" /> & Lt; / Xpath & gt; & Lt; / Region & gt;
Then view your stock tree view.