Search code examples
odoo-8odoo-9odoo-10

Duplicate field issue in form view odoo


I have create one field in stock.quant.package model.

tracking_ref=fields.Char("Tracking Ref")

This field is used in two separate modules and I am not able to give module dependency because both are separate modules.

It may be possible that both modules are installed in same database or it may be possible that in some database only one module is installed.

Due to that reason i have create same field & view in both modules.

But now issue is that if both modules are installed then field is available two times in the form view.

Is there any possibility that if we install both modules then field will visible only one time in form view.


Solution

  • I am not sure it is the best solution. Just try:

    1. Create a new Module, say module_common
    2. Put all common fields and functions in new module module_common
    3. Make this module dependent of another two modules.

    Ex: module_a depends module_common and module_common depends module_common.

    Hope it will resolve your problem.