This question has been flagged
1 Reply
2456 Views

can we related a field to a related field ?

I did 1st object:

_columns = { 'sale_price_unit': fields.related('sale_line_id','price_unit',string='Prix de vente',type='float', store=True, readonly=True), }

2nd object:

_columns={ 'sale_price_unit': fields.related('procurement_id','sale_price_unit',string='Prix de vente',type='float', store=True, readonly=True), }

the value of the 2nd object alwayse equal 0.0 !!

Avatar
Discard
Author Best Answer

Solution

_columns={

'sale_price_unit': fields.related('procurement_id','sale_line_id','price_unit',string='Prix de vente',type='float', store=True, readonly=True),

}

Avatar
Discard