تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4307 أدوات العرض

I create a many2one relationship to view the field referred(crm.lead) in Reference/Description(sale.order) as follows,

        'client_order_ref': fields.many2one('crm.lead.referred','Reference/Description', copy=False),

but it cause the following error when i click the Reference?Description field,

File "/home/amz02/Projects/odoo/odoo-8.0-647afdf/openerp/sql_db.py", line 234, in execute res = self._obj.execute(query, params) ProgrammingError: relation "_unknown" does not exist LINE 1: SELECT "_unknown".id FROM "_unknown" ORDER BY "_unknown"."id...

Any1 can help me,,,,

 

 

الصورة الرمزية
إهمال
أفضل إجابة

Hi, I am not aware object named 'crm.lead.referred'. What i assume is 'referred' is a field in 'crm.lead' object. So if you want to get the value go for related field.

'opportunity_id': fields.many2one('crm.lead','Opportunity Reference', required=True),

'client_order_ref': fields.related('opportunity_id', 'referred', type='many2one', readonly=True, string='Reference/Description')

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Thanks Dinesh,

As per ur answer i got all the opportunity_id in crm.lead,How can i get a particular opportunity_id which is related to a saleorder?

الصورة الرمزية
إهمال