How do I print a field on the report based on whether or not a specific string of values are present?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
We cannot hide/display fields on a printed report, based on specific words, In technical terms “ilike” operator. However, there is a workaround that would make this possible through studio.
In this example I will be taking a store that would like to print the customer Code on the sales order only if the code has the word ASDF in it.
Create Studio Fields
Create a text field using studio on the Sales order and I am going to call it Customer Code
Create a checkbox field on the sales order and I am going to call it Code has ASDF?
I am going to hide the checkbox field on the view so that users cannot change the value of the field.
Create an automated action.
Enable developer mode from Settings.
Go to Settings -> Technical -> Automated Actions
I am going to call the automated action as Enable Checkbox on SO.
Select the model as Sales Order
Trigger as On Creation and Update and Action to do as Update the Record
Set the Apply on Condition as Customer Code contains “ASDF”
Set the data to write as Code has ASDF? With the value “1”.
Studio Report Customization
Go to Studio Report and add the Customer Code field to the report by dragging and dropping it on the report.
Select the field and set the visibility condition Sales Order > Code has ASDF? Is TRUE. If the checkbox is enabled the field will be displayed on the printed report.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 7 24
|
7984 | ||
|
1
thg 12 23
|
3401 | ||
|
1
thg 12 24
|
4970 | ||
Tax distribution import template
Đã xử lý
|
|
1
thg 9 23
|
1947 | |
|
1
thg 2 25
|
2918 |