Hi,
i want to question .
I want to get 'field' in another object.
and, i want get field 'agreement_date' in object 'smcus.pjbs' to object 'smcus.pjp'
file in object 'smcus.pjp' like :
class pjp(osv.osv):
_name = 'smcus.pjp'
owner_date = self.pool.get('smcus.pjbs')
print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', owner_date.agreement_date
pjp()
==================================================================
in object 'smcus.pjbs' like :
class proses_jual_beli_sewa(osv.osv):
_name = 'smcus.pjbs'
_inherit = ['mail.thread']
_columns = {
'konversi_id': fields.many2one('smcus.pjbs.konversi', 'PJBS Konversi'),
'agreement_date': fields.date('Tanggal Agreement'),
'pjbs_name': fields.char('PJBS No.', size=64, required=False),
proses_jual_beli_sewa()
but the result is error :
Traceback (most recent call last):
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/orm.py", line 3718, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/orm.py", line 3841, in _read_flat
res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
File "/home/heru/odoo/openerp-7.0/openerp-7.0-20150118/openerp/osv/fields.py", line 1157, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/home/heru/odoo/addons/CENTURY21/smcus_cn_pjp/pjp.py", line 95, in _get_property_owner
print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', owner_date.agreement_date
AttributeError: 'smcus.pjbs' object has no attribute 'agreement_date'
how i fix my problem ?
thanks in advance ...
you must have to use function(on-change functional or functional field function) then only you will get agreement_date from smcus.pjbs object
ok thanks gpkarthick ....