Missing contacts in odoo chatter - odoo

We are using odoo v13. We have the following problem ...
When we type #L2k in the chatter (log note) it only shows one (the one we added last) of the contacts starting with L2k L2k (see picture).
.
The rest of the existing contacts (see picture) are not shown.
I tested with dfiferent browsers and settings but no idea what causes this.
Any idea?

As you have a custom module, you can check the domain in a _name_search() or name_get() method in the res.partner object.
To verify it, you should commented out entire method and test your desire output. If it works as per your expectation, then you need to fix domain logic.

Related

Populating hidden customfield via python jira

I´m using the python jira package to create and update issues in our self hosted Jira. Sometimes it happens, that issues are created without filling in all information. Because of that, customfields are empty after the creation.
Later, people want to update some fields that were empty before, because now they have new information.
This is not working, I get the error:
"errorMessages":[],"errors":{"customfield_100233":"Field 'customfield_100233' cannot be set. It is not on the appropriate screen, or unknown."}}
I guess this happens because the field is hidden and therefor can´t be updated, because it currently has an empty value.
Has somebody an idea, how to solve this?
I found the solution.
Jira Dropdown Fields can´t be updated to None via a value, you have to set the id to -1.

Open a CRM Entity from a Web Resource

I have a Web Resource that is working fine, except for one major headache.
I need to be able to click on a link and open an existing entity record. These two methods both almost get me there, but are blocked by different reasons:
1. Calling it directly with a link like this:
window.open('http://OurCRM/main.aspx?etc=10088&id=%7bc1d0db62-aa9e-e911-80e0-0a94ef08472f%7d&pagetype=entityrecord', '_self');
The problem with this one is that it doesn't work due to CRM saying
"Sys.InvalidOperationException: Sys.InvalidOperationException: Service Xrm.Interfaces.Services.IMostRecentlyViewedService already has an implementation"
note : If I take out the '_self' it works but then that defeats the purpose of what we're trying to do (need to keep it in the same tab).
2. using the Client API:
parent.Xrm.Utility.openEntityForm('ourentity', guid, '', '');
This one is blocked due to Cross Origin Frames being blocked by browsers.
Does anyone know how to do this?
Below snippet should work: (this will be onclick of button or link)
onclick="window.location.href='http://OurCRM/main.aspx?etc=10088&id=%7bc1d0db62-aa9e-e911-80e0-0a94ef08472f%7d&pagetype=entityrecord';"
To help others out, this was resolved in another, similar question
accessing the logged in CRM user from custom page
Basically we were looking at two different ways to handle the same problem of working with webforms inside CRM.

Getting a table from wikipedia article from it's API

I need to use the table in from this wiki page https://en.wikipedia.org/wiki/List_of_most_visited_museums to make a database in python (though the latter part is irrelevant atm). I have to use the API (can't scrape) to access it. Right now I'm trying the API's documentation https://www.mediawiki.org/wiki/API:Parsing_wikitext#Example_1:_Parse_content_of_a_page Example #2 from this page is exactly what I want to do, but it's returning an error, and even running the original code in my notebook it also returns an error. Can anyone tell me how to either alter that code so it runs, or direct me to another way to do the same thing? Thanks.
This fetches the content you're after: https://en.wikipedia.org/w/api.php?action=parse&page=List%20of%20most%20visited%20museums&prop=wikitext&section=2&format=json
If the example isn't working in your notebook, the problem probably lies with the rest of your code and not with the API call.

Django Autocomplete-light with mutiple apps

I'm using Python 3.4 Django 1.7. My project includes 3 applications that have similar models for example:
I have an ElectricityBill application with:
Account, Meter, Invoice models.
I also have a NaturalGasBill application with:
Account, Meter, Invoice models.
When I register my autocompletes, (Same with both applications), the second will always replace the first.. for example.. when I goto localhost/autocomplete I get this:
InvoiceAutocomplete /autocomplete/InvoiceAutocomplete/
AccountAutocomplete /autocomplete/AccountAutocomplete/
MeterAutocomplete /autocomplete/MeterAutocomplete/
Obviously, there is nothing unique about these urls to indicate which application the url should apply.
Does anyone have a solution for this?
Found this in the documentation:
# Extra **kwargs are used as class properties in the subclass.
autocomplete_light.register(SomeModel,
# SomeModel is already registered, re-register with custom name
name='AutocompleSomeModelNew',
# Filter the queryset
choices=SomeModel.objects.filter(new=True))
A link to the documentation is here: https://django-autocomplete-light.readthedocs.org/en/docs_rewrite/cookbook.html
Registering the autocomplete with a custome name is exactly what I was looking for. It is unfortunate this was so difficult to find in the documentation.

Jira SOAP API custom field

Hi I'm am trying to get the list of issues from a JIRA server using the SOAP API provided by JIRA.
I'm trying to filter the issues based on a custom field (and latter I will want to set that custom field).
If I get the list of issue it returns the custom fields for those issues along with them (I get customfieldId, key, values for each custom field) and I can get the custom field with getCustomFields methods provided by the API (to look for the ID of the field with a given name).
The issue I have is that if I login with an account that is not an admin (using the API) I can't call the getCustomFields method (it throws an exception saying I have to be an admin to do that).
My question is: Is there any other way to know which is the ID of the custom field I desire that can be done using a normal user account?
Also if you know how to set a custom field for an issue, it would also be very helpful :) (I would also like to be able to do it with a regular user account).
You have to be an admin to get a list of custom fields. Any 'normal' account can act on the custom fields via the API provided the user knows the customfield ID.
You can set the value of a custom field too, even with a 'normal' account. Again, the user needs the appropriate permissions to do this. Example provided here.
More here and here.
You can also use getFieldsForEdit(token, issueKey), which will return RemoteField[] for all fields available for edit on that issue (even if it has not yet been defined on the issue). It does not require admin permissions, but because it has the word "Edit" in the method, it does require that you have permission to edit the issue (which means, e.g., if the issue is status=Closed, it will raise an exception unless you allow editing closed issues. Unfortunately, I have yet to find a way to retrieve the RemoteField[] list (in order to map id to name), so getCustomFields() and getFieldsForEdit() appear to be the only options.
Have you tried getting a list of issues from the project, picking one, zeroing out the data, and using that as a template? That might work.
SOAP is being deprecated in favor of the REST API, which also has a better method to get this information