cannot add a record if using _inherits field in form view

Bug #590410 reported by Adrien Guichard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

I use _inherits on product.product in my custom object. If I add the inherited field in the form view, I cannot save it anymore.

I attach a test-case to this bug report.

How to reproduce:
0 - install the attached module,
1 - go to Testcase Aliasing/My Base Product,
2 - press CTRL + L,
3 - Choose a "Base Product",
4 - Click on save!

Thanks for your support,
Adrien

Revision history for this message
Adrien Guichard (guichard-adrien) wrote :
affects: openobject-client-web → openobject-server
Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Andrien,

When you are using _inherits, you cannot have the field in the view by which you have inherited. As its a link to the inherited class and which is by default saved. Its giving such error as its getting two values for the same field. you can have any other field in the view except it. It is not a bug at all.

i.e. in your case
'_inherits = {
        'product.product': 'product_inherited_id'
    }
You can not keep "'product_inherited_id'" in the view.
And "product_id" field is not found either in your given module or in the product module so we can not keep a field which is not found in any of the module.

Thanks.

Changed in openobject-server:
status: New → Invalid
Changed in openobject-server:
milestone: none → 5.0.12
Revision history for this message
Adrien Guichard (guichard-adrien) wrote :

Thanks, I cannot wait for 5.0.12.

In my opinion this ensure better Db schemas. Without this feature, we cannot save a derivated product that inherits from a base product, using an existing base product.

While we are at it, if I display "my_inherited_product" in tree view, but not in form view, I cannot create a new derivated product...

Thanks for your support, I will subscribe to a training!
Adrien

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.