Skip to Content
Menu
This question has been flagged
973 Views

first i have added in my costume module a new field to sale.order view (create quotations) which i called sale_description :

id="view_order_form" model="ir.ui.view">
name="name">sale.order.inherited
name="model">sale.order
name="inherit_id" ref="sale.view_order_form"/>
name="arch" type="xml">
name="partner_id" position="after">
name="sale_description"/>



and i created same field twice in stock.picking view (i created another py file )one in the normal form view under ''delivery address'' the other is inside the notebook ''additional information'' 

id="view_picking_form" model="ir.ui.view">
name="name">stock.picking.inherited
name="model">stock.picking
name="inherit_id" ref="stock.view_picking_form"/>
name="arch" type="xml">
name="partner_id" position="after">
name="my_field"/>



id="view_picking_formm" model="ir.ui.view">
name="name">stock.picking.inheritedd
name="model">stock.picking
name="inherit_id" ref="stock.view_picking_form"/>
name="arch" type="xml">
expr="//field[@name='user_id']" position="after">
name="my_field"/>




 all of these fields show up but the problem is when i fill in the sale description in sale.order i want both fields in stock.picking to be loaded with the same value i entered back in sale.order (exactly like what happens with the all the default fields) so i super'd the

"_prepapre_procurement_values'' method (found in sale_stock/sale_order.py) on my costume sale file like this :

''

def _prepare_procurement_values(self):
res = super(SaleORder, self)._prepare_procurement_values()
res.update({
'my_field': self.sale_description
})
print("i have successfully overrode a method ")
return res


but it doesn't load the values as it was suggested , any ideas ?

''


Avatar
Discard