It is currently Sat Feb 11, 2012 11:17 am

All times are UTC + 2 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help on adding some fields in product.normal.form
PostPosted: Fri Mar 12, 2010 10:27 pm 
Offline

Joined: Fri Jan 22, 2010 11:19 pm
Posts: 115
Hi,

I'm a newbie with openerp and I stuck with a simple problem.

I created a module which extends the product.packaging with some chemical / hazard information.

Everything works fine, the module get's installed and works, except my attempts to add the created fields to the product.normal.form from within the module.

I need the following changes (marked as blue) to product.normal.form

<separator colspan="4" string="Other Info"/>
<field colspan="4" name="name" select="1"/>
<separator colspan="4" string="Hazard Material"/>
<field colspan="4" name="hazmat" select="1" />
<field name="hazmat_volume" select="1" />
<field name="hazmat_lq" select="1"/>
<field colspan="4" name="hazmat_inner_packages" select="1"/>
<field colspan="4" name="hazmat_outher_packages" select="1"/>

</form>

I've read some examples and got a working sample to extend the view_normal_property_form and used the tag
<group name="store" position="after"> to define where my fields should be added.

It worked but I was not able to transfer these code to my needs (I just don't know how to name the position where to add my fields e.g.)

I hope someone could help me,

thanks in advance

MG[quote][/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2010 9:54 am 
Offline

Joined: Fri Nov 21, 2008 9:56 am
Posts: 3061
Location: Lotharingie
use inherited view solution :
http://doc.openerp.com/developer/2_6_vi ... tence.html.

.........
field name="arch" type="xml"
xpath expr="/form/notebook/page/field/form/notebook" position="inside" (or position=after exp=path_to_the_place_you_want)
your code with separator ....
/xpath
........


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 15, 2010 9:31 pm 
Offline

Joined: Fri Jan 22, 2010 11:19 pm
Posts: 115
Thanks Gem,

after some tries I got everything working...

Here is a short version of my xml-file:

...
<field name="arch" type="xml">
<form string="Packaging" position="inside">
... my fields to add ...
</form>
</field>

Everything is working now...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 2 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:

Protected by Anti-Spam ACP