Tags


.xml

<t t-set="source" t-value="o._get_source_details()" />
<span t-field="source.name"/>

.py

def _get_source_details(self,cr,uid,ids,context=None):
    self_bro = self.browse(cr,uid,ids)
    sale_obj = self.pool['sale.order']
    if self_bro.origin and self_bro.type == 'out_invoice':
        sale_sea = sale_obj.search(cr,uid,[('name','=',str(self_bro.origin))])
        if sale_sea:
            sale_bro = sale_obj.browse(cr,uid,sale_sea[0])
            return sale_bro
    return True
Advertisements