Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
701 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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!

อวตาร
ละทิ้ง
ผู้เขียน

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!

ผู้เขียน

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

ผู้เขียน

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!

ผู้เขียน

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!

ผู้เขียน คำตอบที่ดีที่สุด

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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
where can I find export tools? แก้ไขแล้ว
2
ธ.ค. 23
16902
0
มี.ค. 15
3368
2
พ.ค. 24
2411
2
พ.ค. 25
686
1
เม.ย. 25
521