Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
1257 Widoki

Hello everyone,


in the CRM Module (Odoo 17) i have created a custom field to label the Industry of the leads' company.

However when i include the field in an .xsl $ export i do not just get the industry-label i have entered for the field, but also some code which seems to resemble the field.

--> This code is the same for every lead and industry-label.

e.g.: {'7b6eb78b0e52904b': ['healthcare']}


My goal is to be able to export the field without the code and solely the industry-label.


Any ideas?



Thanks for ur help and kind regards

Paul

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Paul Brueckel,

If the field is a Many2one relation, when exporting Lead data, make sure to select "Industry of the leads/Name" or "Industry of the leads/Industry Label" in the export popup. This will ensure that only the label appears in the Excel file.

Thanks!

Awatar
Odrzuć
Autor

Hi Yatrik,
currently the field type is "keyword" as we use the keyword field in the contacts module for labeling as well.
In the export popup i can therefore only select "characteristic".

By setting up a Many2one field i can't put individual labels as i would like, or am i mistaken?

Kind regards and thanks for your help

Hi Paul Brueckel,

Could you please share a video or screenshot to help me better understand the issue?
I’m a bit confused since Odoo doesn’t support a field type called "keyword," so seeing it in action might clarify things.

Thanks!

Autor

Please see the photo i attached to the message above. Can't share videos yet i think.

Autor

Our system runs in german in case you want to translate something

Hello,

I’ve seen the image, and it looks like you’re trying to export the *Branche* field from the CRM lead, correct?
Could you also share a screenshot of the Excel file to show how it’s currently appearing and how you’d like it to appear?

Thanks!

Autor

Exactly!
I have attached the photo above once again as i can't pin it to the comment.
I want the text within the square brackets to be the only thing exported into the excel.

Here are two methods to extract values inside square brackets:
1. In Odoo:
You can create a computed field either using Odoo Studio or by adding it to a custom module.

key_value = fields.Char(string="Key Value", compute='_compute_key_value')
def _compute_key_value(self):
for record in self:
if record.json_field and 'key_name' in record.json_field:
record.key_value = record.json_field['key_name']

Replace json_field with the technical name of your field.
Replace key_name with the actual key, e.g., '7b6eb78b0e5290b'.

Make sure to set this field as Import-Export Compatible so it can be selected in the export popup.

2. In Excel:
You can use the following formula to extract just the label:

=TEXTAFTER(TEXTBEFORE(A1, "']}"), "{'7b6eb78b0e5290b': ['")

Create a new column and paste this formula.
This will extract the label inside the square brackets.

Thanks!

Autor Najlepsza odpowiedź

Hi Yatrik,
currently the field type is  "keyword" as we use the keyword field in the contacts module for labeling as well.
In the export popup i can therefore only select "characteristic".


By setting up a Many2one field i can't put individual labels as i would like, or am i mistaken?

Kind regards and thanks for your help


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
gru 23
17202
0
mar 15
3813
2
maj 24
2937
2
sie 25
347
1
lip 25
1657