Question

I have created a new view for Purchase order form. I want to apply this view when we create a purchase order. However, I did not find any option to replace the default Purchase order form view. I tried with actions. It didn't work.

First on clicking the Purchase Orders, it should display the list of Purchase Orders. Then when we move to create purchase order, it should redirect to the new form which I have created.

Was it helpful?

Solution

there is a field called "priority" on model "ir.ui.view" and default it is set to 16. if you made a complete new form view for purchase.order, just set this field to a lower value. the actions on the purchases menus for purchase.order aren't set to any special view, so the view with the lowest priority will be chosen automatically.

edit: if you want to have a menu wichh opens a form view of purchase order with your defined form view, you have to use it in an action, like:

<record model="ir.ui.view" id="your_form_view_id">
... your form view ...
</record>

<record id="your_action_id" model="ir.actions.act_window">
    <field name="name">Menu Name</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">purchase.order</field>
    <field name="view_type">form</field>
    <field name="view_mode">tree,form</field>
    <field name="view_id" ref="your_form_view_id" />
</record>

<menuitem action="your_action_id" id="your_menu_id" parent="your_parent_menu_id" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top