Hi, i'm Heru.
I want to ask.
I make file, like this.
file1.py :
class pjbs(osv.osv):
_name = 'ruhe.pjbs'
_columns = {
'buyer_id': fields.many2one('res.partner', 'Customer', required=True, domain=[('customer','=',True)]),
}
def view_sale_order(self, cr, uid, ids, context=None):
mod_obj = self.pool.get('ir.model.data')
so_ids = []
val = self.browse(cr, uid, ids)
print "&&&&&&&&&&&&&&", val.buyer_id.name
file1_view.xml :
<record id="smcus_pjbs_form" model="ir.ui.view">
<field name="name">ruhe_pjbs_form</field>
<field name="model">ruhe.pjbs</field>
<field name="arch" type="xml">
<button name="view_sale_order" string="View Sale Order" type="object" class="oe_highlight"
states="sppjbc,leaseagc"/>
</field>
</record>
when I execute, error.
Error message :
AttributeError: 'browse_record_list' object has no attribute 'buyer_id'
How I fix my problem ?
thanks in advance.