Odoo Custom Button in Tree View - odoo

I follow developer tutorial from Odoo documentation and I found that we can make a custom button like check and cross button.
But the problem is, I can't found the source code to achieve those features. How can I add those custom buttons?

it's a simple class that you can use on buttons times for cross and check for ticks
<button name="function_for_button_press" type="object" class="fa fa-check" />
<button name="function_for_button_press" type="object" class="fa fa-times" />
also use style tags to make them look better
list of icons you can use in odoo

In odoo backend form I usually use:
<button name="action_check" type="object" icon="fa-check text-success" string="Check"/>
<button name="action_cross" type="object" icon="fa-times text-success" string="Cross"/>
text-success it is for icon's green color.
I hope this answer can be helpful for you.

Related

How to change active color of Materialize label-icon in search input

I'm new to Materialize and I'm trying to change the active color of the Search and Close icons within a search box. When active, they appear black - I want them to appear white. The examples I've found predate Materialize 1.0. Any help would be greatly appreciated. Thanks!
<form action="" method="post">
<div class="input-field">
<input id="search" type="search" name="search" class="light-blue darken-3 white-text">
<label class="label-icon" for="search"><i class="material-icons">search</i></label>
<i class="material-icons">close</i>
</div>
</form>
https://codepen.io/Cormang/pen/oNvqmmM
By default you can make your search icon active by adding active class to <label>. But it seems there is another event that makes its changes. So one of the ways to addressing this issue is using focusin and focusout.
Add a onfocusin to <input> and call a function like this :
function changeColorOnFocus() {
document.querySelector(".material-icons").style.color = "white";
}
Use a onfocusout and call a function like this to change the icon's color.

How to achieve this input box edit save functionality in Angular 4

I want to achieve the same functionality in Angular 4
Replacing label with input textbox and vice versa by clicking a button in AngularJs
How can i achieve that?
It works basically the same, just use *ngIf for conditional rendering and (click) to handle the click event. editMode has to be a property in your component.ts file.
<form>
<label *ngIf='!editMode'>{{name}}</label>
<input *ngIf='editMode' [(ngModel)]="name" name='name'>
<button (click)='editMode=true'>Edit</button>
<button (click)='editMode=false'>Save</button>
</form>

Web Accessibility Error

When using https://wave.webaim.org/ to check a page for accessibility It detects (3) red errors. seems this is all coming from colorbox jquery.colorbox.min.js
3x empty button
<button type="button" id="cboxPrevious">
<button type="button" id="cboxNext">
<button id="cboxSlideshow">
How can this be repaired? I know that the button type should be Some Content
Not
I had the same problem as you.. All I did was to disable a plugin called Yith compare..

Unable to click on Save button using By.className while className available in div

Unable to click on Save button using By.className while className available in
webpage code for button available
<div class="popupFooter">
<div align="center">
<input id="Preview-btn" class="btn-primary previewDetaile" type="button" value="Preview">
<input class="btn-primary validateProfile" type="button" value="Save">
<input id="clear" class="btn-primary" type="button" value="Cancel">
</div></div>
Selenium Code
driver.findElement(By.className("btn-primary validateProfile")).click();
Problem:
Unable to click on Save button
Your problem is that you search for multiple classnames which does not work with By.className. Just try
driver.findElement(By.className("validateProfile")).click();
instead. For selecting elements by multiple classnames you can find a solution here.
It's very easy with a CSS selector:
driver.findElement(
By.cssSelector(".btn-primary.validateProfile")
).click();
For a full reference:
http://www.w3schools.com/cssref/css_selectors.asp
As #Sebastian pointed out, it's probably due to the fact that By.className accepts only one class name (I think it's not by chance that they didn't name it By.classNames :) )

bootstrap 3 + font-awesome - why won't this button display the image inline?

I have a simple logout button in my navbar and I would like the word "Logout" and the icon from font-awesome to display inline. I thought <span> was an inline tag, but it is causing a line break. I need the span in order to hide the extra text on small screens.
<a href="/logout/" type="button" class="btn btn-default navbar-btn pull-right">
<span class="hidden-xs">Logout</span><i class="fa fa-sign-out fa-lg"></i>
</a>
You can see the problem here: http://bootply.com/94625
try to add:
#media(min-width:768px)
{
.hidden-xs{display:inline !important}
}
the .hidden-xs sets the display of your span to block
It's because you need to download font-awesome and have it in your root directory also point it in your head section. That's because it doesn't show on your live link.
Hope this helps.