Hide 'Add' option from widget="many2many" kanban in odoo 14 - many-to-many

How can i hide 'Add' option from many2many field kanban widget mode.i tried with options="{'no_create': True}" but its not working
<field name="members" widget="many2many_kanban" options="{'no_create': True}"
context="{'form_view_ref': 'project_team.project_team_form_view', 'default_type_team':'project'}"
attrs="{'readonly':['|',('state','not in',['open']),('project_m_user','!=',True)]}">
<kanban quick_create="false" create="true" delete="true">
<field name="id"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click" style="max-width: 200px">
<div class="o_kanban_record_top">
<img t-att-src="kanban_image('res.users', 'image_small', record.id.raw_value)"
height="40" width="40"
class="oe_avatar oe_kanban_avatar_smallbox mb0"/>
<div class="o_kanban_record_headings ml8">
<strong class="o_kanban_record_title">
<field name="name"/>
</strong>
</div>
<!--<a t-if="! read_only_mode" type="delete"
class="text-danger">
<i class="fa fa-times"></i>
</a>-->
</div>
</div>
</t>
</templates>
</kanban>
</field>
Thanks in advance

You can options attribute of the field tag.
In your case, you need to use "no_create" and if you don't allow edit, use "no_create_edit"
For example:
<field name="many2many_field_name" widget="many2many_tags" options="{'no_create': True}"
EDIT:
<field name="members" mode="kanban" widget="many2many" options="{'no_create': True}"

change create="true" to create="false"
it worked for me in the tree view

Related

I'm facing alignment issues with search icon and error message in salesforce LWC

I want the search icon to stay in place when getting the error message. However, I get an alignment issue and it moves down with the error message.
<lightning-layout-item padding="vertical-small" size="3" class="slds-var-p-left_x-small ">
<div class="slds-var-p-bottom_xx-small">
<Label id="ResidencePINCodeLabel"
class="greyh6regularleft">Residence PIN
Code*</Label>
</div>
<div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_right"
onkeyup={handlePincodeSearch}>
<lightning-icon size="x-small" icon-name="utility:search"
class="slds-icon slds-input__icon slds-var-m-bottom_large">
</lightning-icon>
<template if:false={selectedPinCodeValue}>
<lightning-input pattern="[0-9]{6}" autocomplete="off" label=""
required="true" variant="label-hidden" type="tel"
aria-labelledby="ResidencePINCodeLabel"
placeholder="PIN Code" name="PincodeLWC__c" message-when-pattern-mismatch="Not Valid PIN Code"
class="zip-handler input-background">
</lightning-input>
</template>
<template if:true={selectedPinCodeValue}>
<lightning-input pattern="[0-9]{6}" autocomplete="off" label="" type="tel"
required="true" variant="label-hidden"
value={selectedPinCodeName} message-when-pattern-mismatch="Not Valid PIN Code"
aria-labelledby="ResidencePINCodeLabel"
placeholder="PIN Code" name="PincodeLWC__c"
class="zip-handler input-background">
</lightning-input>
</template>
</div>
Image of the error
Please help me! Thank you!

Align form items in a Form with nested FormItems

I am using ant design in blazor. An issue I am currently having is that in nested <FormItem> layout I am not able to align items as a Form. They are currently not inline. Is there any work around? I guess it should be done in some HTML way?
Here is my current code:
<Panel Header="Basic information" Key="1">
<Form Layout="FormLayout.Horizontal" Model="this">
<FormItem Label="Record title">
<Input #bind-Value="#this.Title" />
</FormItem>
<FormItem Label="Description 1235465 ">
<Input #bind-Value="#this.Description" />
</FormItem>
<FormItem Label="Content">
<TextArea Rows="4" #bind-Value="#this.Content" />
</FormItem>
<FormItem Label="Date" NoStyle>
<DatePicker #bind-Value="#this.SelectedDate" ShowTime="#true" OnChange="this.OnDateSelected" />
</FormItem>
</Form>
</Panel>
Here how it currently looks like:
Here is an example of what I am trying to achieve:
You can use LabelColSpan prop on Form component, like this:
<Form
LabelColSpan="6" /* it can be a number between 1-24 */
...
>

How to put two input fealds in anguler align horizonatal?

I need to put two input fields with labels as below.
But In using angular, some data R fields related input not visible. Then, it should be like below.
My code
<div>
<div>
<label i18n="k" *ngIf="model" id="'k'">
<br />
<br />
K:
{{model.k}} </label>
<label i18n="N" *ngIf="model"
id="'N'">
<br />
<br />
N:
{{model.n}} </label>
</div>
<div>
<mat-form-field [formGroup]="DetailForm">
<label *ngIf="isVisible(model.r)">R</label>
<input *ngIf="isVisible(model.r)" matInput formControlName="rate"
[type]="'number'" [placeholder]="'rate'" [required]="false" [readonly]="false" [spaced]="false">
<label>Comment</label>
<input matInput formControlName="c" [type]="'text'" [placeholder]="'comment'" [required]="false"
[readonly]="false" [spaced]="false">
</mat-form-field>
</div>
</div>
But I tried a different way when two input available it shows like below.
need some expert help to resolve this.
I think you need to use 2 different mat-form-fields like this:
<mat-form-field>
<mat-label>Rate</mat-label>
<input matInput placeholder="Placeholder">
</mat-form-field>
<mat-form-field>
<mat-label>Comment</mat-label>
<input matInput placeholder="Placeholder">
</mat-form-field>
Or have a look at this stackblitz, i put a very small demo of the above changes there:
https://stackblitz.com/edit/angular-material-starter-r7khp2

Chrome autocompletes wrong input

I have a strange issue on Chrome (75.0.3770.142). I have vue app with form and two text inputs with different names. When I try to autocomplete the first one it fills the second one instead (and the first input stays empty). I cannot reproduce it out of my application.
My component
<template>
<label class="wrapper" :data-error="validation && errors.first(name)" :class="{ error: errors && errors.first(name), label }">
<span class="label" v-if="label">{{label}}</span>
<div class="input" :class="{
'input--search': type === 'search'
}">
<input
v-if="validation"
:aria-label="ariaLabel"
v-shortkey.focus="shortKey"
:disabled="disabled"
:type="type"
:class="classes"
:value="value"
:name="name"
:placeholder="placeholder"
#search="reset"
#input="update"
v-validate="validation"
:autocomplete="autocomplete"
/>
<input
v-else
:aria-label="ariaLabel"
v-shortkey.focus="shortKey"
:disabled="disabled"
:type="type"
:class="classes"
:value="value"
:name="name"
:placeholder="placeholder"
#search="reset"
#input="update"
:autocomplete="autocomplete"
/>
<Icon class="icon" v-if="iconName && !value" :name="iconName" />
</div>
</label>
</template>
Form:
<template>
<form class="form" v-on:submit.prevent>
<slot />
<Input
v-if="isLabel && displayLabel"
class="label"
ref="label"
type="text"
:label="$t('subscriptions.new.label-placeholder')"
name="label"
:validation="{ required: true }"
:value="label"
#input="onLabelChange"
/>
<hr />
<Terms
v-if="!termsAccepted"
:value="terms"
#input="onTermsToggle"
/>
<Button
class="submit button-next"
submit
:disabled="nextDisabled"
#click="next"
>
{{ $t('subscriptions.new.next') }}
</Button>
</form>
</template>
and screen from Chrome
https://imgur.com/a/hMXVLYP
video:
https://imgur.com/a/gOwulXm
I am not familiar with Vue but you can try using input type as tel for telephone field with attributes like name and autocomplete with values as..
<input type="tel" name="phone" id="yourid" placeholder="+1-650-123-1234" autocomplete="tel">
Not setting autocomplete and incorrect input type for the field could be the reason for this behavior.
Hope this helps.

angularjs custom validation on input type="text"

<section class="col col-6">
<label class="input">
<i class="icon-append fa fa-building"></i>
<input type="text" ng-model="customer.Name" name="customerName" placeholder="Customer Name" required>
<span style="color:red" ng-show="myForm.customerName.$dirty && myForm.customerName.$invalid">
<span ng-show="myForm.customerName.$error.required">Name Required</span>
</span>
</label>
</section>
How can i implement custom validation on it? m applying angularjs validation it works fine but I want custom valuation on this tag. I want user insert only alphabets in this textbox.
Use ngPattern directive and provide appropriate regular expression:
<input ng-pattern="/^[a-zA-Z]*$/" />