Odoo: Make a statusbar button invisible to a group of users - button

I would like the button (draft) to be visible just by a simple user group and not by the group manager. but since the manager is first a simple user before being a manager, how to do it?
Here's the button
<button name="button_draft" string="Draft" states="refuse,approve" type="object"/>
Thank you for your help

Geraldine M
I prefer to create a group and add your users to it and then you can assign the group to your button in two ways:
Using Odoo GUI:
Edit the view and then add groups attribute to your button as below:
<button name="button_draft" string="Draft" states="refuse,approve" type="object" groups="YOUR GROUP"/>
Thanks

Related

Google tag manager does not register click event

I'm trying to set up a click event for a certain button in GA4 Analytics in GTM, but the event does not fire in the preview.
The button has a specific ID. I can see the ID in the DOM, I can see that the gtm.element contains the ID in the API call, but the debug information shows that the Click ID does not match.
I've tested with my front-end developers that the event click events are propagated through the DOM. On a simple image where I've set up the click event in the same way the click event is properly registered.
Any insight in how to solve this is greatly appreciated.
From you screenshots. Looks like GTM detect the click is fired on the <span> inside the button you want.
For this kind of case. I would suggest to use click element as your trigger.
Here is the selector
button#ga_welcome_start_print_job, button#ga_welcome_start_print_job *
This means we want to track the click for the button and all the element inside it.
TLDR; wrap text in an attribute that has id property. Make a custom variable in GTM, of type 'Auto Event Variable' -> Variable Type = Element ID. Then assign to tag.
I had a similar situation. I was using React MUI's Button and I noticed that the id attribute wasn't actually being assigned to GA4's elementId. My guess is the id attribute wasn't 'bubbling' up or it was being processed somehow in MUI which conflicts with GA4. Anyways, I literally just started using analytics, so here's what I did to get it working.
I had a MUI button with the following setup
<Button
id='location-filter-tag'
className='reco-filter-button'
variant={searchState === 'cumulative' ? "contained" : "text"}
size="small"
onClick={() => {
setQueryType('cumulative');
}}
>
<h6 className="some-class">
Location
</h6>
</Button>
Checking the the push event gtm.click below, you can see the id='location-filter-tag' is concatenated into one big string. under gtm.element.
At the time, the gtm.elementId was an empty string (image is of working instance)
I tried to hook into gtm.element and trigger the tag using contains = location-filter-tag but that didn't work. So I moved the id property to the child attribute to get it to register with GA4's gtm.elementId
<h6
id='location-filter-tag'
className="text-overflow reco-filter-text"
>
Then in google tag manager, I setup a variable like so:
Then I assigned it as a trigger. This is my location trigger
hope that helps.

How to close sign post content using directive *clrIfOpen

I am using clarity signpost, I am using this signpost for showing multiple applications, how to close this sign post when i am click on the application.
For example I am adding three buttons in this sign post, if I click on the button this need to be close. Please check my stackblitz
To keep track of whether the signpost is open or not, and then be able to dynamically close it, you should use the de-sugarized syntax of clrIfOpen to utilize two-way binding:
<ng-template [(clrIfOpen)]="signPost">
<clr-signpost-content>
<button class="btn btn-outline" (click)="close()">Hr</button>
...
</clr-signpost-content>
</ng-template>
Here is your example with this change, working fine: https://stackblitz.com/edit/signpost-dynamic-close?file=src/app/app.component.html

Numeric UpDown Control for Xamarin Forms

Can any one Please provide Numeric UpDown Control demo with Xamarin Forms
Does this control Available in Xamarin Forms?
thanks
Prashanth
See edit #2.
No there is not a spinner control out-of-the-box. If you do not want to get creative, you could use the Picker control and insert predefined values into it. Picker info here.
Otherwise it would be pretty trivial to create an up and down Button and an Entry or Label. Clicking the up Button increments a number in the Entry or Label. Clicking the down Button decrements a number in the Entry or Label.
*Edit: Just happened to land on Syncfusion's NumericUpDown control which does want you want. You can also get a free community license for the control if you are a lone developer or a group of 5 or fewer people. Community License info here
*Edit #2: Was looking through the Xamarin Views list page here and saw that actually do have a Stepper control now!
You can use Stepper for this:
XAML
<Stepper Value="5"
Minimum="0"
Maximum="10"
Increment="0.1"
HorizontalOptions="LayoutOptions.Center"
VerticalOptions="LayoutOptions.CenterAndExpand"
ValueChanged="OnValueChanged" />
C#
void OnValueChanged(object sender, ValueChangedEventArgs e) {
lbldisp.Text = String.Format("Stepper value is {0:F1}", e.NewValue);
}
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.stepper?view=xamarin-forms
maybe this could help. you might want to write a custom render for putting that textBox in between the -/+ buttons but sure if you can use as it is, it works fine.

Can we create button in Drupal 7 without writing any code?

I want to create simple HTML button which links to other page when user clicks on it. I am new to Drupal, I've seen that we can create fields from "Structure>Content Types>Article>Manage Fields>Add new field - Field types.."
Can we create button from this way or we have to write code to create it?
Thanks
There is a beta module called Button Field that works with the Rules module. I believe will do what you're looking for. You can add a button to any fieldable entity and define a rule for it when it's pressed.
See https://drupal.org/project/button_field and https://drupal.org/project/rules
Buttons typically have to be coded. The way you're talking about above is the process for creating form elements for creating new pieces of content. If you want a simple button on a page to link to another page, you can just code it as follows:
<input type="button" value="Visit Another Page" onclick="location.href='your/other/web/page'" />
You may need to install a WYSIWYG text editor to add HTML to a page, if you don't already have one.
Or just use the Field Button module:
https://drupal.org/project/button_field
and create the buttons as you create fields...
With the help of views or webform, block module can create a button with out writing code.

How to use own created form to create,update records from the Grid. (Struts2-Jquery-Grid Plugin)

Can this be possible, I created a Jquery grid struts2. What I did was added this in the Jquery grid.
<s:url id="editurl" action="nedit"/>
Then added this options in the
navigator="true"
navigatorAdd="true"
navigatorSearch="true"
navigatorRefresh="true"
navigatorDelete="true"
resizable ="true"
draggableZindex="true"
navigatorAddOptions="{height:525, width:425, readAfterSubmit:true, draggable:true, resizable:true}"
navigatorEditOptions="{height:525, width:425, reloadAfterSubmit:true, draggable:true, resizable:true}"
navigatorDeleteOptions="{height:200, width:200, reloadAfterSubmit:true, draggable:true, resizable:true}"
Then enable the collumn of the grid to be editable by adding editable="true".
<sjg:gridColumn name="serial_Number"
index="serial_Number"
title="Serial_Number"
editable="true"
sortable="true"/>
Because of that, There are now buttons where you can add, edit and delete record. + for add record, pen for edit record.
Is there a way in which when I click the + or pen button I will use my created form to add the new records? I don't want to use the dialogue box with form created when i click the + or the pen button. I want to use my own form.
As a summary, this is what i like to be done. When I click the + it will transfer to my add record action. When the pen button is click it will go to my edit action plus the key records coming from the grid.
Hope my question is comprehensible.
Thanks
You can add addfunc in navigatorAddOptions and
editfunc in navigatorEditOptions so the grid will run your custom function instead.
You can call your own form in your own function.
More info here
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:navigator

Resources