Skip to Content
Menú
This question has been flagged
2 Respostes
7997 Vistes

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?

Avatar
Descartar
Best Answer

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.

Avatar
Descartar
Autor

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.

Autor

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()

Best Answer

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

Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
de març 15
9606
0
de març 15
6866
4
de febr. 24
12466
2
de nov. 18
24195
0
de març 15
3905