Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
520 Tampilan

i wrote

from odoo import models, api, _, fields


class account_journal(models.Model):   

      _inherit = "account.journal"

     retenue_account_id = fields.Many2one('account.account', 'Retenue Account')


but when installing module, it is not created when fetching fields

 

Avatar
Buang
Jawaban Terbai

Hello,

If the field is not being created even after installing the module, there could be a few reasons for this:


1. Check Module Dependencies: Ensure that your module's __manifest__.py file correctly specifies any dependencies that are needed for your module to function properly, especially if your module depends on other modules that modify the account.journal model.

2. Check Log Messages: Look at the Odoo server log messages when you install the module. It might provide some clues about what's going wrong. Look for any error messages related to your module or the account.journal model.

3. Check Module Installation: Make sure that your module is installed correctly. You can check this by going to the Apps menu in Odoo and verifying that your module is listed and marked as installed.

4. Check for Python Errors: Ensure that there are no syntax errors or other issues in your Python code. A small mistake can prevent the field from being created.

5. Check for Field Overriding: Ensure that there are no other modules that are also trying to modify the account.journal model and potentially overriding your changes.


Hope it helps.

Avatar
Buang
Jawaban Terbai

Hi Jamel mharshi,

Check your logs.

maybe you not import this file in __init__.py inside.

so please clarify first.

Thanks.

Avatar
Buang