Reputation: 91
I'm trying to inherit and add/remove some fields from the default New Product page in openERP. I'd like to change the behavior of the default "Create" button in the Search Products view to send users to the new modified Products page, but I can't seem to change it. I've tried XPath, position="replace", and a few other things, but nothing seems to work. How do I grab it? Just use XPath and replace it with another button?
How do I change the results of clicking on that button?
Thanks,
Upvotes: 1
Views: 2054
Reputation: 73
As I understand you want to modify product form view and remove some of the unnecessary fields for your application.
you just need to create inherited views for the fields you need to remove from the form view. for 6.1 to remove the weight field in product form view
<?xml version='1.0'?>
<field name='weight' position='after'> </field>
- to remove the weight field just change the position property with replace
<?xml version='1.0'?>
<field name='weight' position='replace'> </field>
save the inherited view, its done. you can also achieve this by just adding invisible to the filed property like
<?xml version='1.0'?>
<field name='weight' position='replace'><field name='weight' invisible='1'?></field>
if there are more than one inherited views referring to the same field you may need to increase or decrease the sequence value of the inherited view to change the order of inherited view to get the necessary behavior.
Upvotes: 0
Reputation: 13342
You don't describe what you want to achieve, but a possible solution coudl be:
Upvotes: 0
Reputation: 6295
Jeff,
You can not remove the create button by uisng XPath, position="replace". The Create Button is part of the From view Template which you can find in the web addons part formview js file. and qweb xml template, and You can modify it web with some hard code but that will affect all view as that create button is the Generic/ Common Template to all Views. So Even if you try CSS and JS stuff I do not suggest.
Thank You,
Upvotes: 0
Reputation: 5044
I think you are trying the remove the create button shown in the tree view. To remove it there is an openerp module called web-remove-quick-create
. Its in the openerp apps. Please use this. Otherwise try to modify the jc and css files.
Thank you
Upvotes: 1