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

Hello,

I need help to solve this problem :

Field `journal_id` does not exist

Error context:
View `account.asset.asset.inherit`
[view_id: 2748, xml_id: n/a, model: account.asset.asset, parent_id: 1256]
None" while parsing /home/ubuntu/custom_modules/asset_custom/views/view.xml:2, near


    
        account.asset.asset.inherit
        account.asset.asset
        
        
            
                
            
        
    

This is my code:

class AccountAssetInherit(models.Model):
_inherit = 'account.asset.asset'

journal_id = fields.Many2one('account.journal', string='Journal', required=True)

And this is the view:





account.asset.asset.inherit
account.asset.asset








May anyone help in finding the solution?

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

this is the view:
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="account_asset_asset_inherit" model="ir.ui.view">
<field name="name">account.asset.asset.inherit</field>
<field name="model">account.asset.asset</field>
<field name="inherit_id" ref="om_account_asset.view_account_asset_asset_form"/>
<field name="arch" type="xml">
<field name="account_analytic_id" position="after">
<field name="journal_id"/>
</field>
</field>
</record>

</odoo>

Hi,
Try this video: https://youtu.be/-zXnlycSXog
Regards

คำตอบที่ดีที่สุด

There are many cases for this error:

First you have to make sure that you imported the py file (which you created to add "journal_id") in the __init__.py

Second just try to comment the view and upgrade your addons, after that uncomment the view code and upgrade the module again.

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

may u explain what you meant by commenting the view?

I mean comment the xml of the view by adding <!-- before view and -- > at the end of the view.

ผู้เขียน

still facing same issue

ผู้เขียน

Is there another solution because I checked the __init__.py file ,and it contains the models file as well as I commented the view ,as you recommended but sill the same issue

Related Posts ตอบกลับ มุมมอง กิจกรรม
8
มิ.ย. 18
48389
2
มี.ค. 15
10379
1
มี.ค. 24
1760
1
ต.ค. 23
1840
Filed does not exist error. แก้ไขแล้ว
1
ส.ค. 23
2154