It is currently Sun Feb 12, 2012 8:31 pm

All times are UTC + 2 hours




Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Fri Jul 03, 2009 8:05 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Hello Naresh,

I did not create the view but it could something like that (i think) :

<xml>
<openerp>
<data>
<Modify>

<record>
<field>form_partner_my_new_view</field>
<field>res.partner</field>
<field>form</field>
<field>
<field>
<field>
<page>
</field>
</record>
</data>
</openerp>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 8:13 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Oops, something went wrong; here's the code again :

<record model="ir.ui.view" id="form_partner_mwprog_10">
<field name="name">form_partner_mwprog_10</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="res.partner.property.form.inherit"/>
<field name="priority" eval="28"/>
<field name="arch" type="xml">
<page string="Accounting" attrs="{'invisible': [('groups', '<>', "Administrator / Configuration")]}" />
</field>
</record>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 8:22 am 
Offline

Joined: Thu May 29, 2008 12:58 pm
Posts: 208
Location: Gandhinagar,Gujarat,India
Hi,
Follow This example.

<record model="ir.ui.view" id="ID OF NEW VIEW">
<field name="name">NAME OF NEW VIEW</field>
<field name="type">form</field>
<field name="model">MODEL</field>
<field name="inherit_id" ref=VIEW ID/>
<field name="arch" type="xml">
<notebook >
<page string="OLD TAB TO REPLACE" position="replace" >
<page string="NEW TAB " groups="YOUR GROUP to show the tab" >
<NEW FIELDS TO DISPLAY>
</page>
</page>
</notebook>
</field>
</record>

_________________
Regards,
Naresh Choksy


Last edited by Naresh Choksy on Fri Jul 03, 2009 8:44 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 8:35 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Thanks you, I'm going to try that.
Will post the result in a few minutes.

:)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 9:25 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
.. small little problem with the inherit_id :

the name of the form I'd like to inherit is : res.partner.property.form.inherit
it's id is : view_partner_property_form
this view is included into the module Account


In my code, if i insert the following line I've an error when upgrading
<field name="inherit_id" ref="view_partner_property_form"/>

If I insert the following line :
<field name="inherit_id" ref="account.view_partner_property_form"/>

than I can make the upgrade but when trying to display the partners, i receive an application error :

File "/usr/lib/python2.5/site-packages/openerp-server/addons/base/ir/ir_model.py", line 274, in check_groups
cr.execute("select 1 from res_groups_users_rel where uid=%s and gid in(select res_id from ir_model_data where module=%s and name=%s)", (uid, grouparr[0], grouparr[1],))
IndexError: list index out of range


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 9:32 am 
Offline

Joined: Thu May 29, 2008 12:58 pm
Posts: 208
Location: Gandhinagar,Gujarat,India
It seems there is problem in your groups can u paste what u have done.

_________________
Regards,
Naresh Choksy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 9:43 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Ok, without the groups attribute, this is working. As soon as I add the groups attribute (<page string="Accounting" groups="Employee" position="replace">) I have the following error :

File "/usr/lib/python2.5/site-packages/openerp-server/addons/base/ir/ir_model.py", line 274, in check_groups
cr.execute("select 1 from res_groups_users_rel where uid=%s and gid in(select res_id from ir_model_data where module=%s and name=%s)", (uid, grouparr[0], grouparr[1],))
IndexError: list index out of range


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 10:17 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
the following line doesnt generate an error but my rule is never applied ..

<page string="Accounting" groups="base.Employee" position="replace">


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 10:37 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
ok, found the problem :
I need first to remove the tab which is not depending of a group. Then I create a new tab this time depending of a group.
<page groups='"Base.Employee" string="Accounting">

but if I'd like to create these page for all groups except the employee one, what is the syntax (I already tried <> , != but it's now working...)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 6:19 pm 
Offline

Joined: Fri Dec 08, 2006 3:46 pm
Posts: 175
Location: Caracas, Venezuela
Hi,
Quote:
but if I'd like to create these page for all groups except the employee one...

Well you can create a group (all_noemployee) with al group except employee one


Regards,

_________________
Javier Duran
Venezuela


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 03, 2009 11:17 pm 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
didnt think to that .. great idea :)
thanks

it's not working for the while, i have some problems of inheritence. For the while, it did not replace the 'old' account tab but create a new one, so i've 2 account tabs !
Still looking for a solution
regards to all
Arnaud


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 07, 2009 1:57 am 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
Further to this, I created a group called "Wheel" and the admin user is a member. I added nothing to any of the other tabs when creating this new group, because I'm after hiding a page and it wasn't listed in the possible objects.

I duplicated the "Accounting" page and changed only this:

<page string="Accounting">

to this:

<page string="Accounting" groups="Wheel"> which breaks

and this:

<page string="Accounting" groups="base.Wheel"> which runs.

But then no one can see that tab, not even the admin user! I looked in res_groups with psql and "Wheel" seems to be its only name.

How should I be specifying that group?

By grepping through everything, I find lines like:
Code:
crm_configuration/crm_jobs_menu.xml:242:        groups="base.group_extended"/>


Just what 'groups' are being talked about here? I see nothing like that in the table:

Code:
uni30=# SELECT id,name FROM res_groups;
id |             name
----+-------------------------------
  6 | Partner Manager
  7 | Maintenance Manager
  1 | Administrator / Configuration
  2 | Administrator / Access Rights
  3 | Employee
  4 | Useability / Extended View
  5 | Useability / No One
  8 | Useability / Product UoS View
  9 | Product / Manager
10 | Human Resources / Manager
11 | Human Resources / User
12 | Finance / Invoice
13 | Finance / Accountant
14 | Finance / Manager
15 | Project / Financial Manager
16 | Project / Manager
17 | Project / User
18 | Wheel

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 26, 2009 12:18 pm 
Offline

Joined: Tue Oct 14, 2008 12:39 pm
Posts: 69
Location: Colchester, England
Hi Gemlog

I don't think the group matching is done on Name, it is on ID.

Try using groups="18" as a test.

If you have imported the group from an XML file and given it a textual ID then you can use that instead. Textual IDs are stored in the ir_values table I believe

Hope this helps

Russ


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 26, 2009 12:38 pm 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
Thanks russellb! I will try that out next.
This thread was getting pretty lonely without your input :-)

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 27, 2009 9:49 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Thanks russellb, too

I'm going to try that, too and display my results :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 46 posts ]  Go to page Previous  1, 2, 3, 4  Next

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