How can I add new states for a country in OpenERP/Odoo? - odoo

I was trying to find the file where the states for US are charged to the data base , but I only found res.country.state.csv file, and I modified adding other record then restart the server, and nothing happened.
If anyone have a tutorial o pdf guide to help me. I would appreciate it very much.
Thanks...

States data are defined in res.country.state.csv file as you mentioned.
You can define a new file like this one or just modify it respecting that format.
To visualize your changes, don't forget to update base module (restarting server not enough).
If you create a new file don't forget to add it to data section in _ _openerp_ _.py

Related

TYPO3: How to restrict the file upload in Powermail with the file formats

I am using powermail where I have added a file upload which I want to restrict with PNG,JPG and PDF file formats. Since I unfortunately do not work as long as TYPO3 and the extension Powermail I do not know exactly where I have to make the changes.
I have already seen in another forum post that you can make the adjustments in the setup.
plugin.tx_powermail.settings.setup.receiver.overwrite{
upload.file_extensions = jpg,png,pdf
}
Best regards
You can configure the allowed fileextension as TypoScript constant plugin.tx_powermail.misc.uploadFileExtensions.
So, the TypoScript (in constant section) should look like:
plugin.tx_powermail.misc {
uploadFileExtensions = jpg,png,pdf
}
file_extensions seems to be a configuration value years ago (The mentioned post was from 2011), but does not exist in the current powermail code.
It might be useful to know that in Powermail 9.0.2 this configuration doesn't work. This is how to acheive the same result in Powermail 9
plugin.tx_powermail.settings.setup.misc.file.extension = jpg,png,pdf

Wrong "ReflectedWorkItemIDFieldName" while migrating Azure DevOps Work Items

I am testing the azure-devops-migration-tools and have create a project using https://azuredevopsdemogenerator.azurewebsites.net/ (Parts Unlimited). I have generated the configuration.json and changed the Source and Target so I can test a migration, but I'm getting errors while migrating Work Items.
[15:14:41 ERR] Error running query
Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException: TF51005: The query references a field that does not exist. The error is caused by «ReflectedWorkItemId».
I've tried different options on the "ReflectedWorkItemIDFieldName" field, Scrum, Basic, Agile, Custom, empty but am still unable to migrate the work items.
How can I get the value to put on this field for the specific project?
Thanks,
Bruno
Quick Solution: Most ADO instances use the prefix 'custom' for new fields. Try "Custom.ReflectedWorkItemId" in your configuration.json to see if that resolves the problem.
More details: It's hard to tell without an actual configuration.JSON file to review. One possible problem is that you need to use the actual and full internal 'Name' of the ReflectedWorkItemID field. This doesn't show in ADO, or the Process Template when created. The recommendation is that you create a query referencing your custom field, and export the WIQL file (query file). Once you export the WIQL file, you can then open the file and see the full syntax of the custom field.
Exporting Queries: If you don't know how to do this, it can be done with VisualStudio. If you don't know how to do that, you can install this extension. It's a handy WIQL import/Export and editor. Install, and your ADO Queries with have an Edit in WIQL Editor option. Create a query that exposes your 'ReflectedWorkItemID' as a column, then edit that query in the WIQL editor and see the full names of the Reflected Work Items ID Feild. https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor
SELECT
[System.Id],
[System.WorkItemType],
[System.Title],
[System.AssignedTo],
[System.ChangedBy],
[Custom.ReflectedWorkItemId]
FROM workitems
WHERE ...
I found a possible solution. I have created a custom process, change the process from the projects to this new one and add a new field. This is the field I'm using on the configuration.json and now I'm able to migrate work items
To make the migration in the "ReflectedWorkItemIDFieldName" you must do:
"Organization Settings" -> Process -> Select the process where you project are (Basic, Scrum, Agil, or CMMI).
then click on the 3 dots and create a new Inherited process.
Then with the inherited process, you are able to create a new field for each work item type. The name that you type (could be "IronMan") that name will be in your configuration file.

Configure SQLFluff rules

I use SQLFluff to ensure a uniform syntax in the company and reduce error warnings before running the models in dbt. Since our syntax does not completely match the syntax of SQLFluff I would like to make some changes.
The Rules References provided by SQLFluff helped me to set up Inline Ignoring Errors, as displayed in the code below (last line of code).
So I have two questions, which I was not able to answer also with the help of the Rules References of SQLFluff.
I would like to set Rule L032 as default 'false' without typing it manually every time in my SQL.
How do I change the maximal length of a line regarding Rule L016? I would like to set the default value e.g. 150.
SELECT
country.country_name,
country.population,
currency.currency_name,
currency.currency_id,
currency.strange_long_variable_name_which_is_too_long as not_so_long_variable_name
FROM country
LEFT JOIN currency
USING (country) -- noqa: L032
I tried to figure it out with the Rules References but could not figure it out. Help is very much appreciated!
Try looking into .sqlfluff config file
https://docs.sqlfluff.com/en/stable/configuration.html#
With the help of #suhprano's answer, I was able to find the proper solution for my issue. For this reason, I will post an answer to my own question. I do this intending to provide others assistant with similar issues.
I created the .sqlfluff file in my user profile folder. In this file I have then included the following:
[sqlfluff]
exclude_rules = L032
[sqlfluff:rules]
max_line_length = 150
In this case, SQLFluff will load the configuration from any .sql file found at the path specified on this variable.
Just an addition to the answer:
The default config of the rules can be found inside the package in file core\default_config.cfg
See also:
https://github.com/sqlfluff/sqlfluff/blob/main/src/sqlfluff/core/default_config.cfg
https://docs.sqlfluff.com/en/stable/configuration.html#defaultconfig
As already mentioned by #Albin the easiest way to override the config is to add a .sqlfluff file in the user profile folder.
See also:
https://docs.sqlfluff.com/en/stable/configuration.html#rule-configuration

Call a data from a database in a .ini file

I have a little problem about my .ini file. I am using LabVIEW to pilot a Power Supply GPD-2303. And I have to configure the Voltage and the Current searched for each cards. These datas are in a Database but I have only a read access on it.
Voltage, Name, AlphaNumCode... Are not a problem because it will probably never change so my code is looking like:
[AlphaNumCode]
VSET_1=VALUE
VSET_2=VALUE
CSET_1=VALUE
CSET_2=VALUE
Assembly_PN=VALUE
That's to set Voltage, Current at the start of the execution on LabVIEW and give an Assembly PN "IF KQG then AssemblyPN= 1633".
That's the situation. The problem is there:
[Assembly PN]
CURRENT1_PROG_SEARCHED=VALUE
CURRENT2_PROG_SEARCHED=VALUE
CURRENT1_BLANK_SEARCHED=VALUE
CURRENT2_BLANK_SEARCHED=VALUE
I want to transform it, because if this value is not a fix value. I am looking for Something like:
[Assembly PN]
CURRENT1_PROG_SEARCHED="VALUE IN COLON W, LINE X"
CURRENT1_PROG_SEARCHED="VALUE IN COLON W, LINE X"
CURRENT2_PROG_SEARCHED="VALUE IN COLON X, LINE X"
CURRENT1_BLANK_SEARCHED="VALUE IN COLON Y, LINE X"
CURRENT2_BLANK_SEARCHED="VALUE IN COLON Z, LINE X"
I have found: https://support.microsoft.com/en-us/kb/149090
But it show how to interact with the colon but not with a specific case. Is there a command?
That's the last thing I have to do in my Internship to end this project and I do not like let things unfinished.
Hope someone can help me or give me documents to learn how to do it, it will be great :)
Edit:
Yes, this article show how to access data by a text file, and the text file is linked to the data in the database, I was thinking that could work.
I am clearly new about database so I am sorry about the lack of knowledge I will try to do my best, but using SQL server and System DSN to Access it in LabVIEW.
The ini File is read in a LabVIEW Program
By"COLON" I mean "COLUMN
Edit:
I send you my Sub VI and a picture of my code, that's what I want. still having 2 days to end it so I hope you can read me guys!
[1630]LINE=WHERE (OC=1630);
[1631]LINE=WHERE (OC=1631);
[1632]LINE=WHERE (OC=1632);
[1633]LINE=WHERE (OC=1633);
[1635]LINE=WHERE (OC=1635);
LabVIEW Picture of the Sub VI 25/07/16 using DB Select Tool Kit
Best regards,
Robin.
I have found a solution, in fact I am using a .ini file to send a condition:
Just to know: (OC = Assembly Number)
In my .ini I have:
[1633]
OC=WHERE(OC=1633);
Then I send it to the condition in DB Select Tool Kit and I enter the column / table where is the data I am looking for.
Then if a new card need to be test they just need to make a new line in the .ini file:
[XXXX]
OC=WHERE(OC=XXXX);
Thanks for your help that problem is resolve, I hope it can help someone that want to make communication between LabVIEW / .ini / Database
Best regards,
Robin

MS Project - VBA - Changing resource type

Sorry if the question has been answered but I looked a bit on the site and it has helped in many ways already !
I was asked to do in VBA some programming to transfer data into MS Project.
I managed to do it all except for one thing, when I create a resource, Project automatically describes it as a Work Type and some of mine are actually Material Type.
I then thought of changing it after creating the resource and assign it to a task
My bit of problematic code is the following
Set NR = .Resources.Add(name:=tmpTxt)
.Resources(k).Type = pjResourceTypeMaterial
.Resources(k).Assignments.Add TaskID:=j
When I run it I don't have any error message, but in the resource view on MS Project the Type hasn't changed...
I would be very grateful if any of you can help me !
Is there some code you haven't included in your extract that associates NR with .Resources(k)? It looks like you have created a new material resource and tried to set the resource type of some other existing resource to "Material". Can you please include the with . . . end with construct?
Without seeing more of the problem I'm not completely sure what you are having trouble with but assuming you are referencing the ActiveProject all you need to do to create a new Material type resource is:
Set NR = Activeproject.Resources.Add (name := "A New Resource")
NR.Type = pjResourceTypeMaterial