[REGRESSION in 5.0.11] mandatory fields that should be inherited are now reported missing!
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
High
|
Anup(SerpentCS) |
Bug Description
Hello,
On 5.0.x stable, since server revision #2066 by Jay Voara, there is an important regression (meaning that 5.0.11 has it and previous versions are OK):
usually, if you create an object which inherits an other existing object and you specify that object id to inherit from, then the object validation should take into account the existence of the inherited fields by means of that specified id.
To be more concrete, here is what I do, I try to create a product.product (a variant) and I specify an existing product.template through the template_id field. So fields such as 'name' should be inherited from that specified product.template and that's how it was working before revision #2066.
However, after #2066, the server will complain that the field "name" is missing in that case!
If I create a product.product without specifying a tmpl_id, then that's true, the 'name' field is mandatory. But If, on the contrary I'm inheriting like here, I just want to inherit that field and I don't want every inheriting object to try to write the same parent 'name' field!
A way to reproduce the issue is to install the product_
In the case of the product_
[...]
DEBUG_RPC:
DEBUG_RPC:
WARNING:
null value in column "name" violates not-null constraint
: Integrity Error
For information that regression has been detected with the OOOR RSpec unit test suite here: http://
(just run rspec path_to/
specially the following statement that now fails:
it "should skipped inherited default fields properly, for instance at product variant creation" do
#note that we force [] here for the default_get_fields otherwise OpenERP will blows up while trying to write in the product template!
create(
end
Again, this has deep consequences, I think you better revert the commit if no fix is found because currently it looks like you tried to fix multi-level inheritance at the cost of breaking the single inheritance feature which is a bit nonsense...
Hope to see this reverted or fixed, thanks.
Related branches
Changed in openobject-server: | |
status: | New → Confirmed |
Hi Raphaël Valyi,
I will check it very soon and will post more.
Thanks a lot for reporting.