class LotExpiration(models.TransientModel):
_name = 'lot.expiration'
_description = 'Lot/Serial Expiration Report'
location_ids = fields.Many2many(
'stock.location',
string='Location',
help='Leave empty to include all locations'
)
exclude_sublocations = fields.Boolean(
string='Exclude Sub-Locations',
default=False,
help='If checked, only main locations will be included (sub-locations will be excluded)'
)
report_file = fields.Binary(string='Report File', readonly=True)
report_filename = fields.Char(string='Filename', readonly=True),error cumming from this part i think, error isodoo.tools.convert.ParseError: while parsing /home/project18/src/custom/ckc_lot_expiration_report/wizard/lot_expiration_views.xml:3
Error while validating view near:
<group>
<field name="location_ids" widget="many2many_tags" placeholder="Select Locations" options="{'no_create': True}"/>
<field name="exclude_sublocations" invisible="location_ids"/>
</group>
<group>
Field "exclude_sublocations" does not exist in model "lot.expiration"
View error context:
{'file': '/home/project18/src/custom/ckc_lot_expiration_report/wizard/lot_expiration_views.xml',
'line': 6,
'name': 'lot.expiration.view.form',
'view': ir.ui.view(1947,),
'view.model': 'lot.expiration',
'view.parent': ir.ui.view(),
'xmlid': 'lot_expiration_view_form'}
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,
The error occurs because Odoo cannot find the exclude_sublocations field when parsing the XML view. This usually happens if the Python model defining the field is not loaded before the XML, or if module dependencies are missing in the manifest.
In Odoo, XML views are loaded in the order specified in the module’s __manifest__.py. If a view references a field from a model that hasn’t been loaded yet, it triggers a “Field does not exist” error. Similarly, if the module depends on models from other modules (like stock.location), those modules must be included in the depends list to ensure the related models exist before XML parsing.
To fix this, ensure all necessary modules are listed in depends (e.g., 'base' and 'stock') and that the Python model is loaded before the XML in the data section. After updating the manifest, upgrading the module will apply the correct loading order and prevent the field-not-found error.
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 | |
---|---|---|---|---|
Error installing local Odoo
Đã xử lý
|
|
2
thg 2 25
|
3277 | |
|
1
thg 9 24
|
13089 | ||
Installation odoo 14
Đã xử lý
|
|
1
thg 8 21
|
10704 | |
|
1
thg 3 15
|
6749 | ||
|
1
thg 8 20
|
5071 |