Skip to Content
Menu
This question has been flagged
1 Reply
2983 Views

I'm facing an issue with extending the res.partner model in Odoo. I want to create a custom field named in res.partner model as bank_tag and the custom field doesn't appear. Larger module neutrovis_localisation has two sub-module which is neutrovis_ar_ap and neutrovis_invoice_note as its sub-module. Sub-module neutrovis_ar_ap works finely.

Sub-module (neutrovis_invoice_note) of a larger module (neutrovis_localisation):

  • neutrovis_localisation/__init__.py: 
    from . import neutrovis_ar_ap  #neglect, another sub-directory under neutrovis_localisation
    from . import neutrovis_invoice_note 

  • neutrovis_localisation/__manifest__.py: 

     'name': "Neutrovis Localisation", 
     'author': "Neutrovis", 
     'website': "https://www.neutrovis.asia", 
     'category': 'Localization', 
     'version': '1.0', 
     'depends': ['base', 'neutrovis_contact','account'], 
     'data': [ 
     'neutrovis_ar_ap/security/accounting_access_rights.xml', #neglect, another sub-directory under neutrovis_localisation 
     ], 
     'installable': True }


  • neutrovis_invoice_note/models/__init__.py: 
    from . import account 

  • neutrovis_invoice_note/models/account.py: 
    from odoo import models, fields 
     class ResPartner(models.Model): 
     _inherit = 'res.partner' 
     bank_tagging = fields.Char(string="Bank Tagging")

I've checked the module dependencies and initialization order, and there doesn't seem to be any conflicts with other modules or data files. I've also tried uninstalling and reinstalling the neutrovis_localisation module, but the issue persists.

Does anyone have any ideas on what could be causing this issue and how to resolve it?

Thank you in advance for your help.


Avatar
Discard
Best Answer

you can check the following points:

  1. Make sure that your module is installed and upgraded: Ensure that you have installed and upgraded the neutrovis_invoice_note module after making changes to the code. You can do this by restarting the Odoo server and updating the module list.

  2. Check the module dependency order: Verify that the neutrovis_invoice_note module is installed after its dependencies (base, neutrovis_contact, and account) are installed. The order of installation can affect the inheritance and field addition process.

  3. Verify the module structure: Double-check the file structure of your module to ensure that the file paths and names are correct. Confirm that the __init__.py and __manifest__.py files are placed in the correct directories. Also, ensure that the file names and class names are spelled correctly.

  4. Check for any other modules modifying res.partner: Ensure that there are no other modules in your Odoo instance that modify the res.partner model and conflict with your changes. Check if any other modules have overridden the same field or view where you are trying to add the bank_tagging field.

  5. Verify the field definition: Review the account.py file in the neutrovis_invoice_note module to ensure that the field definition is correct. Make sure the field name (bank_tagging) and model inheritance (_inherit) match the parent model (res.partner). Also, confirm that the account.py file is being imported correctly in the __init__.py file.

After making any changes, remember to restart the Odoo server, upgrade the module, and clear the browser cache to ensure the changes are properly reflected.

Avatar
Discard
Related Posts Replies Views Activity
2
Mar 19
4386
1
Mar 15
5491
1
Mar 15
4824
1
May 25
65
2
Apr 24
985