This question has been flagged
1 Reply
2582 Views

I think (it would be nice to have) projects related to orders

currently there is a link between project and customer, which is good, but an order may be executed by a project ...

Avatar
Discard
Best Answer

Hey!!!

You can add a filter when you click on search, you will choose Order and then it will display for you all the projects by order.

Here is an example of a filter:


<record id="view_order_project_filter" model="ir.ui.view">

<field name="model">your_class_name</field>

<field name="arch" type="xml">

<search string="Order Projects">

<field name="your_field"/>

<group expand="0" string="Group By...">

<filter string="Project Order" icon="terp-personal" domain="[]" context="{'group_by':'order_field'}"/>

</group>

</search>

</field>

</record>

In your python, you should inherit the class to be able to call the order_field!!!

There is an other solution, you can add a related field which will order your projects by their orders.


#we need a related field in order to be able to sort the projects by orders

'order_related': fields.related('project_field', 'order_field', type='char', string='Name Order', readonly=True, store=True),

Regards!!!

Avatar
Discard