Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
1176 Zobrazení

Hi everyone,

I'm developing my custom module, and everything works fine until I try to inherit from res.partner.

As soon as I attempt to inherit from res.partner, the build tests fail immediately with errors, as shown here

However, when I update my module directly from Odoo.sh, the new field appears correctly in the res.partner model. But if I push my code, the resulting build test are failing (red status).

Here is my res_partner.py file:


from odoo import models, fields class ResPartner(models.Model): _inherit = 'res.partner' x_octave_create_date = fields.Date( string="Date de création (Octave)" ) x_octave_write_date = fields.Date( string="Date de modification (Octave)" )

And my __manifest__.py file contains:


'depends': ['base', 'contacts'],

Am I doing something wrong?

If I inherit another model, I don't have this issue.

Any ideas on what might be causing this?

Thanks in advance for your help!

Avatar
Zrušit

Hello Félicien  

I tried to do this in my local machine and it worked just fine

Please share with us the error you get and the whole code

Nejlepší odpověď

Hi,

The issue you're facing is related to the depends declaration in your module's __manifest__.py. The res.partner model is defined in the base module, not in contacts, so if you're only inheriting res.partner to add custom fields and not using any additional views, menus, or features from the contacts module, there's no need to include contacts in the depends list. In fact, adding unnecessary dependencies like contacts can cause problems during Odoo.sh builds, especially if those modules introduce extra views, fields, or constraints that conflict during testing. Since the contacts module itself already depends on base, including base alone is sufficient for accessing and extending res.partner. Removing contacts from your dependencies can resolve build errors and simplify your module’s dependencies.


Please refer to the code below:

In manifest:


'depends': ['base'],


Hope it helps.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
bře 24
3357
1
říj 23
5326
0
zář 23
1779
0
dub 23
1802
1
čvn 22
6562