Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
6731 Vistas

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
Descartar
Autor

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

Mejor respuesta

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
Descartar
Autor

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.

Autor

still facing same issue

Autor

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

Publicaciones relacionadas Respuestas Vistas Actividad
8
jun 18
48124
2
mar 15
10200
1
mar 24
1563
1
oct 23
1681
1
ago 23
2007