Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
1184 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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!

Ảnh đại diện
Huỷ bỏ
Tác giả

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!

Tác giả

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

Tác giả

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!

Tác giả

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!

Tác giả Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 12 23
17177
0
thg 3 15
3794
2
thg 5 24
2914
2
thg 8 25
183
1
thg 7 25
1613