Skip to Content
Menu
This question has been flagged
1 Reply
1396 Views

Long story short, I have a custom field on purchase order line level (line reference), and I would like to pass this information on on the purchase order. The user should be able to filter purchase orders based on the purchase order line references etc.

As the purchase order and purchase order line models are already linked, I thought I would be able to simply create a related field on purchase order model that would include all the purchase order line references of this particular purchase order. So I created a related field on the developer mode on the purchase order as follows:

- model: purchase order

- field type: char

- related field: order_line.linereference (in which linereference is my custom field on purchase order line model)

However, based on some testing it seems that the result of this approach is that the related field on the purchase order level contains only the line reference of the first purchase order line. I'm sure that as a beginner I have misunderstood something, and any help would be greatly appreciated!


Avatar
Discard
Best Answer

Your way is correct and since you already created the field, You can add this field to purchase order search view, open purchase order tree view and enable developer mode and from debug icon select EditControlPanelView and add the below line under origin field:

<field name="x_ linereference" filter_domain="[('x_linereference ', 'ilike', self)]"/>


then refresh the page and try to search for any reference. 

Note: Make sure the added field type is the same type of the purchase order line field.


Avatar
Discard
Author

Thank you for a response and your help, it's really appreciated!

I did try the code suggested, but I still have the same problem. For example if I have a puchase order P00100 which has line1 with a reference AAA and line2 with a reference BBB. If I filter the purchase orders with reference AAA the purchase order P00100 shows up, but if I make the same search with reference BBB it doesn't.

If I add the related field x_linereference as a shown column on my purchase order tree view, the shown value for P00100 is AAA (even though there is line2 with a reference BBB). So it seems to me that there is a problem with the related field. Any thoughts?

Related Posts Replies Views Activity
2
Dec 24
3132
1
Dec 24
352
4
Nov 24
1366
1
Sep 24
1137
1
Sep 24
1203