Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
6739 Tampilan

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?

Avatar
Buang
Penulis

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

Jawaban Terbai

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.

Avatar
Buang
Penulis

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.

Penulis

still facing same issue

Penulis

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

Post Terkait Replies Tampilan Aktivitas
8
Jun 18
48135
2
Mar 15
10206
1
Mar 24
1569
1
Okt 23
1691
1
Agu 23
2016