This question has been flagged
2144 Views

I made a field.char in purchase.order_form, and i can fill it:

from openerp.osv import fields, osv

class product_template(osv.Model):

_name = 'purchase.order'

_inherit = 'purchase.order'

_columns = {

'container_number': fields.char(string='Número contenedor', help='Número de contenedor', size = 30),


Now, i want to show that field as readonly in stock.view_picking_form.(in other module i created)  Now its showing the string, but now taking the data filled in puchase order.

from openerp.osv import fields, osv

class product_template(osv.Model):

_name = 'stock.picking'

_inherit = 'stock.picking'

_columns = {

'numero_containers': fields.related('origin','container_number',type="char",relation="purchase.order",string="Número de contenedor",readonly=True),

}



What i am doing wrong.






Avatar
Discard