It is currently Sun Feb 12, 2012 8:34 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 Sep 18, 2009 3:29 pm 
Offline

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

I'm back with this problem. So I just pass 2 hours testing the different solutions but nothing.
It seems that there's no possiblity to replace a complete page in a notebook. When I'm trying that (<page string="Accounting> position="Replace">
the system just creates a new empty page with the name "Accounting".

Now, I just would like to make 3 fields disappear when the users is not the admin ... but it seems no possible for the while ..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 18, 2009 6:20 pm 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
Here's a working stanza that replaces a page with 'nothing', ie removes it:

Code:
    <record model="ir.ui.view" id="view_partner_contact_form_inherit_1">
        <field name="name">res.partner.contact.form</field>
        <field name="model">res.partner.contact</field>
        <field name="inherit_id" ref="base_contact.view_partner_contact_form"/>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <page string="Extra Information" position="replace">
            </page>
        </field>
    </record>


I haven't had time to revisit oerp or removing a page based on permissions.

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 18, 2009 8:32 pm 
Offline

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

I already tried that but when applying, I get a new page with the same name but blank.. so after having applied, I got 2 sames pages with the same name but one is blank ...

I finally foud how to display a page depending of the user. I dont have my notes here but will post the solution next monday...

Hope this will help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 19, 2009 1:21 am 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
Yay! Thanks forestera, good timing as i'm going back to that office on Monday :-)

Not sure why you can't nuke a page though if you have the closing page tag to what you posted above (I know, you know -- don't shoot me for the suggestion). It's just all I can think of. Unless there's a "hidden" character or in the page you're replacing, like it appears the same character, but it's in a different charset and therefore doesn't match? Try hiding a different page just for fun maybe. Or cp/pasting everything within the quotes from the module that originally defined the page.

edit: one more thought is that you are inheriting the right form? It's:
Code:
    <!-- Recreate the Accounting tab with group permissions -->
    <record model="ir.ui.view" id="view_partner_form_inherited_pe00">
      <field name="name">res.partner.form</field>
      <field name="model">res.partner</field>
      <field name="inherit_id" ref="base.view_partner_form"/>
      <field name="type">form</field>
      <field name="arch" type="xml">
        <page string="Accounting" position="replace">

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 19, 2009 11:54 am 
Offline

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

I will check that on monday, promise and try to hide another tab.

;)
Have a nice week-end

Arnaud


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 21, 2009 7:15 am 
Offline

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

So, I tried to hide another page but same problem : the page doesn't 'disappear' and new blank page is created beside with the same name ...

Don't know, maybe the commande position="replace" is not possible with a page .....

But, the good news is that I can hide/display a page depending of the user or a group. I need to make more research but the idea is the following : to display only to some users, you have to have the following syntax :

<page>

The fiels module and name are the one of the table ir_model_data. I tried to insert the values base.user_admin and this allows to display the page only to people that belong to group admin.

Hope this help.

If anybody has an informatio about making a page disappearing (or maybe just to say it's not possible)..


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 21, 2009 9:49 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
A good point for you Gemlog. Everything is working fine now. You were right, the problem of displaying a page or not was a problem of inheritance. In my new custom form, I made an inherit from the account object (the one that was displaying the account informations) but that was not a good solution. So I change it with the base.view.partner.form and everything's working fine. Now only people that are belonging to the group account_manager have the page 'Accounting' displayed !

Thanks for your help
Regards

Arnaud


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 21, 2009 3:35 pm 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
Good!
But I still do not know how to display per user--please?

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 21, 2009 6:07 pm 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Hello,
I wont be at the office till wednesday. There's no information in the table ir_model_data about unique users but a solution would be to create one group per user and to allow only this group to display some informations.

I will check that on wednesday ..


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 19, 2009 12:53 am 
Offline

Joined: Fri Nov 03, 2006 9:02 am
Posts: 111
Location: BC, Canada
gemlog wrote:
Good!
But I still do not know how to display per user--please?


I meant per group, sorry about that.

I've tried groups="13" per russelb and a zillion other combinations of base with Finance / Accounting, dots, underscores, you name it. I can make it disappear (for everyone), break it for everyone, or be visible to everyone and that's it.

Any other ideas on how 'groups=' might work?

edit:
One correct incantation I've found now is:
groups="base.group_extended"

I would love to know the way to reference the other groups properly. Especially the finance groups.

_________________
Regards, Paul Evans


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 23, 2009 3:04 pm 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Hello, Here's what I did concerning the finance. I've some fields that are displayed only if the the user is member of the account manager group :

<group col="2" colspan="2" groups="account.group_account_manager">
<separator string="Customer Credit" colspan="2"/>
<field name="credit" select="2"/>
<field name="credit_limit" select="2"/>
</group>

Hope this help


Regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 04, 2010 10:38 am 
Offline

Joined: Fri Jan 08, 2010 11:55 am
Posts: 25
Hi,
I have the same problem: I am trying to hide the Accouting tab to users that are not in account.group_account_manager.

Extending the view as below, creates a new empty tab while keeping the older one.

The new tab is only shown to the proper users (the groups attribute works).


Code:
<record>
   <field>res.partner.form.security.inherit</field>
   <field>res.partner</field>
   <field>form</field>
   <field>
   <field>
      <notebook>
         <page>
            <page>
            </page>
         </page>
      </notebook>
   </field>
</record>



I tried inheriting from the account view (account.view_partner_property_form) but got the same result.
Any hints?

Thanks

_________________
Jose A. Corbacho
Trobz (www.trobz.com)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 04, 2010 10:40 am 
Offline

Joined: Fri Jan 08, 2010 11:55 am
Posts: 25
Ooopss...

Code:
<record id="view_partner_form_security_inherit" model="ir.ui.view">
   <field name="name">res.partner.form.security.inherit</field>
   <field name="model">res.partner</field>
   <field name="type">form</field>
   <field name="inherit_id" ref="base.view_partner_form"/>
   <field name="arch" type="xml">
      <notebook>
         <page string="Accounting" position="replace">
            <page string="Accounting" groups="account.group_account_manager">
            </page>
         </page>
      </notebook>
   </field>
</record>

_________________
Jose A. Corbacho
Trobz (www.trobz.com)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 04, 2010 10:48 am 
Offline

Joined: Tue Aug 14, 2007 4:08 pm
Posts: 360
Hello,
I'm not an expert in xml code, but for me , I first removed the fields I wanted to hide and then insert those fields only for account_manager groups.

But to remove or add a component, you need 1 ID or view name per action. That means that If you want to remove 2 fiels, you'll need 2 times the stucture you displayed (every structure with another name and id.

Hope this help


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 05, 2010 6:01 am 
Offline

Joined: Fri Jan 08, 2010 11:55 am
Posts: 25
Hi,
thank forstera for you reply.

I don't really get how to do it. Do I have to create a new view with all the information for partners I want to be displayed?

I'm trying to hide a field in Partner form ("Accounting") depending on user's groups.
Also, I need to hide other fields in that form (no dependencies, just hidden for everyone).

Do I have to create a new view replicating the Partner's one from the "account" module? What if this module changes?!?!. I'd just want to inherit from it and modify one of the fields.

Is it possible to do anything like this?

Thanks.

_________________
Jose A. Corbacho
Trobz (www.trobz.com)


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