How to create a drop down list in odoo12 and fill in it by values from 1 to 5 for example - widget

i have to create a drop down list (using widget selection) and fill in it by numbers from 1 to 3 for example. below the code who i writed but the drop down list is empty.
Any help please

You can either create a selection field or many2one field. I will explain both cases.
Selection field
one_selection = fields.Selection([('one','1'),('two','2'),('three','3')],string="Selection Field)
xml: <field name="one_selection"/>
Many2one field
one_id = fields.Many2one('new.model',string="Many2one field)
xml: <field name="one_id" widget="selection"/>
Please be informed that in selection field the option will come automatically. But in many2one field we have to create the option for that we have to create a new model as below:
class NewModel(models.Model)
_name="new.model"
provide the fields. and create a menu for the new model, where you can create the options that will come in the many2one list
I think you need only a selection field.

Related

Drop down list in access form and displaying the data from the next column

Please help me with the following topic.
I'm having a hard time inserting a form in which i need to select from a drop down list the name of the project and below to display the data from the ProdFinit column.
I've tried using combo but i'm new to Access and i thing i'm missing something.
Thank you for your help!
You're on the right path using a combobox. Look at the format tab on the design properties for your combobox. Here I have a form where the user inputs the zip code, but I also want the user to identify the city and state at the same time. My column count is 3 and I chose how wide to make those columns on the next line down. Beware what column to bind it to on the datatab of the properties box. I find binding it to column 1 is easiest.
ComboBox Properties
Zipcode Combobox

Filter rows in SSRS based on parameter and Field

I am new to using the filters in SSRS. But I would like to filter Accessories (Yes, No). This is a parameter with a yes and no Value which would display/ filter rows based on the field Field!class.Value= "I" or "A" accordingly.
So If the drop down is yes it should only display rows with class "I" otherwise All "I" and "A"
How would I do this in the Taxlib filters property. It is not working for me, the way I need it to.
Help would be immensely appreciated as usual! :)
Modified as per OP corrected logic ..
Create your parameter Label Yes with value ="I" and No with value ="*"
In your table properties, filter section, click add button.
Below I am filtering type field against the parameter. You need to select the class field from the drop down list.

How to reference a comboboxes to input values into a query?

How to a get the value of value selected in a combo-box? I have a combo-box called "cndGetUsage" in a form called "frmStationUsage". How do I get the value in the form and check to see if a value was selected?
This are being referenced from a module called mMainOutputs.
myval = Me.cndGetUsage.Column(1)
or
myval = [Forms]![frmStationUsage]![cndGetUsage].Column(1)
these will tell you what the current value in the box is. the columns are because in access your combo box can have multiple columns. also if you set the bound column then you don't have to specify it.
Where are you populating the list from? It works great if you're using a Select statement, from a table with a unique ID field as a unique key. Your combo box index is zero based. If you have more controls in the form you can use the Recordset Clone and Bookmark statements to move back and forth as you select items from the combo box

Autocomplete Fields in Split Database

I created a data entry from and split my database to front-end and back-end. When I enter in data I want certain fields to autocomplete. To be specific, I want to do something like (assuming the term Request had been previously entered) when you type in Requ... it would show Request and you could just press enter or tab to move to the next field. I don't want the rest of the fields autofilled, just individual fields autocompleted. Not sure if the fact that the database is split prohibits this?
Using a form, set the controls for the fields you want to autocomplete to comboboxes and the row source of the combo to a select from the table:
Control Source : MyFieldToComplete
Row Source : SELECT DISTINCT MyFieldToComplete FROM MyTableWithMyField
Limit To List : No
There are wizards for building combos, or you can change controls manually with right-click.

MS Access Dropdown List/Combo Box

This should probably be pretty simple but my Google-Fu is as yet unable to find an answer. I simply want to create a dropdown list in Access so that upon selection I can perform some action based on the value of the selection. For instance, I have a list of people and I would like to populate the combo box so that their names appear in the list but the "value" is set to their ID (the primary key).
It sounds like you might be asking how to display something in the dropdown other than the ID while keeping the ID as the returned data from the dropdown. If that's the case set the Bound Column to the ID field (usually 1) and (assuming the name field is next) set the Column Count to be 2 and the Column Widths to be 0";1" or 0";[whatever width you need].
You will need to hook into the onchange event for the dropdown list.
and from MSDN
How have you set the properties for your combo box?
Perhaps you could try setting (assuming you are pulling data from Table1 with fields ID and Field1
Row Source: SELECT [Table1].[ID], [Table1].[Field1] FROM Table1;
Row Source Type: Table/Query
Bound Column: 1
Column Count: 2
Column Widths: 0", 1"
and then hook into the onchange event as Chris Ballance suggests. The value property of the combo box is ID; the text will be what is in Field1.
OK, I figured it out even though it was a bit counter-intuitive. An Access Combobox can have as many values as you want (instead of just one key on value). By default all of the values are are shown in the list so you need to hide certain columns by setting their widths to 0. That is done via the ColumnsWidths property in the property pane. ColumnWidths takes a comma separated list of values which corresponds to the order of the columns in the list. I hope this helps someone.