Skip to Content
Menu
This question has been flagged
2 Replies
655 Views

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

Avatar
Discard
Best Answer

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!

Avatar
Discard
Author

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!

Author

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

Author

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!

Author

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!

Author Best Answer

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


Avatar
Discard
Related Posts Replies Views Activity
2
Dec 23
16875
0
Mar 15
3334
2
May 24
2304
2
May 25
538
1
Apr 25
424