Here is my code ,problem is when I click on purchase_order_data1 button the sale order 'name' field should be add in 'so_number' of purchase.order form( this is my custom field ).But its not coming .Need a help.......
<button name="purchase_order_data1" string="Test" type="object"/>
class sale_order(osv.Model):
_inherit = "sale.order"
_description = "Validate quote"
_columns = {
}
def purchase_order_data1(self,cr,uid,ids,context):
if not context: context={}
for id in ids:
deg_obj=self.pool.get('sale.order').browse(cr,uid,id, context=context)
my_id=deg_obj.name
context.update({'default_so_number':deg_obj.name})
return{
'view_type': 'form',
'view_mode': 'form',
'res_model': 'purchase.order',
'context': context,
'type': 'ir.actions.act_window',
'nodestroy':True,
'target':'inline',
}
# my_id=int(deg_obj.my_products)
# prr= int(deg_obj.categg_temp)
# pch= int(deg_obj.categ_temps)
# cch= int(deg_obj.categ_temp2)
<record id="purchase_order_inherited" model="ir.ui.view">
<field name="name">purchase</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<group>
<field name="so_number"/>
<field name="project_name" />
<field name="client_po_number"/>
</group>
class purchase_order(osv.Model):
_inherit='purchase.order'
_columns={
'so_number':fields.integer('S.O.Number'),
}