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

Is it possible to display a many2many field in the sale order print?

I would like to show the categories from the sale order on the quotation and the order confirmation. I do not know if it is even possible to use this field here.

The field I want to display is "categ_ids". The value is stored under the table crm_case_categ.

I have tried using: [[(o.categ_ids and o.categ_ids.name)]]

This keeps showing up as: browse_record_list(1)

I have also tried: [[repeatIn(objects,'o')]] [[repeatIn(o.categ_ids,'line')]] [[(o.categ_ids and o.categ_ids.name)]]

But this returns the same value.

Does anyone know how I can achieve this?

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

Try this;

[[repeatIn(objects,'o')]] [[repeatIn(o.categ_ids,'line')]] [[(line.categ_ids and line.categ_ids.name)]]

I am not sure but hope this will work.

الصورة الرمزية
إهمال
الكاتب

Hello Sudhir, thank you for your very fast response. I appreciate you taking the time.

I used your suggestion, as is visible here: http://i.imgur.com/v9lLXlw.png

Right now it isn't displaying anything, but before I had fixed some syntax errors - it was displaying some weird symbols and faulty values. Those have all disappeared, but sadly the desired value is not being shown.

I still feel we're "on the right track" but not quite there.

Else you can create one method in parsing py and call it from report.

الكاتب

I have never made a method before. I suppose I need to add this method to sale_report.py. I also figure I need to run this method under the report designer using the execute command.

So now I need to create this method first.

Would this be the right way to do it?

Example: class other_object_name2(osv.osv): _inherit = 'other.object.name' _columns = { 'other_fields': fields.many2many( 'actual.object.name', 'relation object', 'actual.object.id', 'other.object.id', 'Other Field Name'), } other_object_name2()

أفضل إجابة

<para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, order_line.taxes_id)) ]]</para>

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مارس 15
9612
0
مارس 15
6868
4
فبراير 24
12467
2
نوفمبر 18
24198
0
مارس 15
3907