Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3550 Visualizzazioni

https://apps.odoo.com/apps/modules/11.0/base_module_record/

I want to use this module to add a field to the project.task model.  I want the field to be a relation field that references a field (parent_id) in the project.project model.  I want to then be able to search for tasks that belong to a project that has a particular parent_id.  I also want these changes to remain after I update the source code.

Can 'Base Module Record' assist me to do this?  If it can, can someone provide step-by-step instructions on how to achieve it?

Avatar
Abbandona
Risposta migliore

Hi Bill, 

The module will not be able to do such a customisation.

You mentioned the field 'parent_id' on the 'project.project' model, this is not standard Odoo as far as I know. Your customisation will therefore be customising another module that you have installed. Without a proper dependency in place this could wreak havoc.

Even if you were referencing a standard field, I would have to strongly advise against using this module.  Any changes like this should always be done in code in order to keep your project clean, and free from a giant number of single purpose modules.

If you know the module you are using to add 'parent_id' to the 'project.project' model, I would be happy to lend a hand in making this change for you.

Regards,
Jake Robinson
Dionysus Software

Avatar
Abbandona
Autore

Thanks for the reply Jake. The parent_id field is created by the V10 OCA module account_analytic_parent which, although not officially migrated to 11, appears to work fine in it. As for 'Base Module Record', my understanding is that it should produce an installable module containing xml code that reflects the changes made during the recording process, though explanatory notes for the module are very limited and I haven't had any luck getting more detailed information from the developers, so I can't really say I know what the module is actually for.

Hi Bill,

Modules built for v10 will generally work in v11 as long as there haven't been changes around the specific part the module is targeting, so this is quite safe.

Your understanding is correct, but the issue comes with the more specific details of Odoo. Even if we ignore the fact that all changes to a models structure should preferably be done in python, not XML, the depends issue is still in play: Any time you do a base upgrade on a copy of the database, it doesn't know which module to install first. If it tries to install your new module before the the module that introduces the 'parent_id' on the 'project.project' model, it with throw an error.

I've taken a look at the 'account_analytic_parent' module that you have spoken about, and it seems that what you're asking is a little trickier than you mentioned. This module introduces parents for analytic accounts, not for projects. Though you could find the parents by finding the projects analytic account, find its' parent analytic account and then find its' related projects, this wouldn't be a straight one to one relationship.

Analytic accounts allow for multiple projects per account, and their parent account could then contain multiple projects. Even if this isn't how you have set your data up, the data types of the fields are structured that way, meaning a simple related field isn't possible.

As a heirarchy you can also have multiple levels of parents, did you want to be able to search grandparents, great-grandparents, etc.?

These kinds of tasks are much more suited to developers, so your best bet is to engage a developer or start learning a little bit of python to unlock the full potential of Odoo.

Regards,

Jake Robinson

Dionysus Software

Post correlati Risposte Visualizzazioni Attività
5
ago 24
3434
1
apr 22
9784
0
gen 22
2861
2
ott 21
9137
1
set 21
4002