On creating a new user in odoo, as we assign some group to user, how to do some operation? - odoo-9

Look at the following image, I want to make Client drop down visible as User assigns 'Clients' group to a new user otherwise it should be invisible.
How to do this?
Click To see Image

you should the make the visibilty limited for the menus under dropdown.
example:
<menuitem id="menu_id" name="name"
parent="parentmenu_id" sequence="0"
groups="id_of_client_access_group"
/>

Related

Rails: disable input tag upon selection from a dropdown menu

Scenario/Context
I've got a drop down menu with two input elements underneath.
From the dropdown menu, are names of companies (with values set to the respective company id's), and another prompt to Add a new company.
If the option to Add a new company is selected from the dropdown, then the user is to fill out the 2 input field elements (i.e. company name and company email).
Otherwise, if an available company is selected from the dropdown,
then the 2 input fields (for company name and email are to be disabled).
My question
Is this possible to do without an AJAX call if I want things to happen without a page refresh?
Can anyone suggest some other alternatives??
Many thanks!
That is absolutely possible, though you'd need to use some JavaScript to make it happen and load a bit more data to the DOM on the initial page load.
For each option in your company select dropdown, add a data attribute for the name and email.
Then, watch that dropdown for the change event in JavaScript. Whenever that event is fired, if the data-company-name and data-company-email attributes are defined for the selected option, disable the input fields and populate them with those values. If those data attributes are not defined for the option (likely only for your 'Add a new company' option), then clear the values from the input fields and enable them.

Validations while navigation between tabs in Tabview [Nativescript with angular]

I have used Tabview in my application. There are six different tabs in component.
I need to do validations while try to navigate to next tab likewise between all the tabs.
Like required field validations, If any required fields are not entered means users can’t able to navigate next tab.
Any idea on this?
Thanks in advance.
You can try this -
XML
<Page>
<TabView selectedIndexChanged="onSelectedIndexChanged">
...
</TabView>
</Page>
TS
export function onSelectedIndexChanged(args) {...}
Based on the selected Index you check for validation and redirect it back to the previous index or route it to Login Screen or whatever.

Form View Based on Access

How can I hide form view based on users access?
For example : If I log with user1
I can see all customers (created by me and user2) in kanban end tree views.
In form view only view my customers.
I think the only way to achieve this is by updating the form view itself. You would put all of the contents into a div and hide it if the user_id (or whichever field you want to base the rule in) is someone else.
Effectively, it would look something like this:
<div attrs="{'invisible': [('user_id', '!=', user.id)]}">
# normal form view fields and formatting
</div>
If the user_id field does not default to the logged in user, it's possible that the form fields would hide by default when creating a new record. You would be able to bypass it with something like this (which allows you to see records that aren't assigned to a user) instead:
<div attrs="{'invisible': [('user_id', 'not in', [user.id, False])]}">
You have to make two groups for that.
First one is for admin and second is for users.
In kanban and tree, you have to give the fields admin rights or apply group 1 on tree and kanban view.
In form view you have to give the second group so, it will perfectly work as per your requirements.

Watir clicking nested elements inside a container

I'm trying to complete a happy path e-commerce payment test but I cant seem to click on the nested element for credit card to be honest I'm not entirely sure which is the clickable element.
Any help to get this working would be appreciated.
When inputting forms, you typically want to interact with input and select elements. In this case, you can see that the visible input field is a radio button - ie <input type="radio">.
You access radio buttons using the radio method and select it by using the set method:
browser.radio(id: 'cc-payment').set
The element you want to click is the input with type radio. You should be able to do something like:
driver.find_element(:css, "input[id='cc-payment'][value='creditCard']").click
I'm curious if clicking on the parent item would resolve.
#browser.input(id: 'cc-payment').parent.click
If the div registers the click and sets the input then this might work. You should be able to manually verify this beahviour by clicking outside of the radial and seeing if it selects.

How to apply filter/specific criteria for browser UI component in Exact Synergy Enterprise?

I am creating a maintenance page where I want to select a task using browser UI component. What I want to do specifically is to filter and show only tasks that are not done yet. Can I implement this using browser UI component? Does Exact Synergy Enterprise offer other components for this functionality?
You should create your browser Repository Explorer and use it in browsefield UI component.
Go to System tab, process to Setup tab and under the Repository section click Explorer. Locate your Repository group, enter it, click Browsers tab next to Business components, Functional components, etc.
Click Add and provide Name, Caption, Caption suffix fields. Then write your SQL query in Query field. The structure is:
SELECT <column(s)> FROM <database table> WHERE <column(s)> IS NOT NULL ORDER BY <column>.
Leave the Column info field empty for now. Fill in the Result columns field with column name which will be used as a Browser component result.
Finally, add database table name in the Table list field. Click Save + Edit column info button. Edit column names from a list shown below Information section and fill in Header/Term ID field with title, describing your columns (this will be shown in Browser UI for the front-end user). Click Save and test your newly created browser. If something went wrong, repeat steps from the start. Most of the time problem could be wrongly filled Column info field.
Now go to your ASPX page and add browsername attribute to your browsefield UI component. Doing so will set the browserfield component to your newly created browser component. This is that you want to see in your maintenance page when setting up the browsefield UI component:
<ex:cardfield runat="server" id="cf" caption="Item" captionid="0">
<ex:browsefield runat="server" id="p" browsername="pbr" datasource="bc" />
</ex:cardfield>
Hope this gives you quick idea of what you need to do in order to adjust it to your situation with tasks.

Resources