Reputation: 489
By default, the create contact form from Contacts and create Vendor form from Purchase appears to have the same External ID ie, base.view_partner_form. I want to replace the form view for create contact. Now, i know that to replace a view i'll have to do this in my custom form view.
<field name="inherit_id" ref="external_id_of_form"/>
So how can i replace the form view in this case so that only the contact create form gets replaced? Can i replace the form view based on action? `
Upvotes: 0
Views: 198
Reputation: 14801
You're not "replacing" by inheriting, but changing/extending other views.
Indeed you should change the menu actions, because it is possible to set the target views.
But there is more than one approach. I'll try to list some of them, plus you can combine them.
full single views
ir.ui.view
of same type for the same modelone base form with different extension views
one view with extension views
groups
, attrs
, invisible
, etc.IMO the best approach for you is the first one. An Odoo example are the views for model account.invoice
, because there are two form views: one for customer invoices and one for supplier invoices.
Upvotes: 3