Hello In my current system I have more than 1000 locations imported but without location barcode. I don't want to import it with excel. Is there any way I can bulk generate location barcode within Odoo ?
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ờ
Hi 👋,
In Odoo Online (SaaS), you can't run backend scripts, so the only way to generate location barcodes in bulk is by exporting the data, updating it in Excel, and re-importing it.
If you're using Odoo.sh or On-Premise, you can automate this using a Python script or the Odoo shell.
So:
- Odoo Online → Use Excel import.
- Odoo.sh / On-Prem → Automation via script is possible.
# Run in Odoo shell
locations = env['stock.location'].search([('barcode', '=', False)])
for loc in locations:
loc.barcode = f"LOC-{loc.id:05d}"
Yes, you can bulk generate location barcodes in Odoo by using a custom script or automation. You can create a scheduled action or a simple script using Odoo Studio or Python to automatically generate barcodes for each location. You’d need to use a barcode generation library (like python-barcode) and associate the generated barcode with the respective locations in Odoo.
Hi,
Yes, we can do it using an Odoo Server Action. You can create a Server Action in Odoo to generate and assign barcodes to existing locations in bulk automatically.
1.Settings->Technical-> Action->Server Action
Type: Execute Code
Model : Inventory Location
'barcode': 'Loc' + str(rec.id)
This sets the barcode to a string starting with 'Loc' followed by the record's ID.
Example: If the location's id is 123, the barcode will be 'Loc123'.
You can change 'Loc' + str(rec.id) to anything that fits your business needs.
2. Then, select all locations from the tree view (Inventory > Configuration > Warehouse Management > Locations), click the Action button, and run the Location Barcode server action. You will see that barcodes are automatically assigned to the selected locations.
Result:
Hope it helps.
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 | |
---|---|---|---|---|
|
1
thg 6 25
|
1450 | ||
|
0
thg 4 24
|
1491 | ||
|
0
thg 1 24
|
1470 | ||
|
0
thg 2 23
|
1685 | ||
|
3
thg 12 22
|
4365 |