openerp - Display the sale order customer reference field in the delivery order view -


I am trying to display customer reference as a read only field in the Delivery Order Form view.

I have added a related field to the stock.paching.out model:

class_picking_out (osv.model): _inherit = "stock.paching.out" _columns = {'Cust_order_ref': fields.related ('sale_id', 'client_order_ref', type = 'char', string = 'customer reference'}}}

I see the delivery order with legacy The following blocks are found in:

  & lt; Record id = "view_stock_picking_out_edended" model = "ir.ui.view"> & Lt; Field name = "name" & gt; Stock. Picking.out.extended.form & lt; / Field & gt; & Lt; Field Name = "Model" & gt; Stock picking. Out & lt; / Field & gt; & Lt; Area name = "inherit_id" ref = "stock.view_picking_out_form" /> & Lt; Field name = "arch" type = "xml" & gt; & Lt; Xpath expr = "// field [@ name = 'original']" position = "after" & gt; & Lt; Area name = "client_order_ref" /> & Lt; / Xpath & gt; & Lt; / Region & gt; & Lt; / Record & gt;  

When I install my custom module, I think the model is updating with a new field, and I also see that a new field appears in the delivery order view is. However, the value of this field is always empty, even if there is a customer order reference in the respective sales order (sales_id), can someone explain to me what I am doing wrong here?

Thanks in advance.

stock.paching this object stock.picking.in Before joining any new field in .out , try it with a quick code, we have to add it to the original class <(stock sale), stock packing.

Type 'sales_id', 'client_order_ref', type = 'char', string = 'customer reference', 'Client_order_ref', type = _inherit = "stock.paching.out" _columns = {'cust_order_ref' 'Four', string = 'customer reference')}}

Please change your .xml file.

  & lt; record id = "view_stock_piking_out_edited_format "Model =" ir.ui.view ">  field picking < Xml "& gt; xpath expr =" // field [@ name = 'original'] "position =" after "& gt; field name =" cust_order_ref "/>  

Hope this will solve the problem.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -