You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[16.0] When you open a form view by python, default values for an one2many field cannot be retrived if these fields are not defined in tree view
#117122
Open
lihaotong100 opened this issue
Mar 30, 2023
· 1 comment
Any updates on this ?
It seems that this is still happening in v17 as well
I've hit this one by simply trying to use default_item_ids (Pricelist Rules) on the product.pricelist model (using advanced pricelists) and I did not understand why only some values where being set and the others not ...
Here's a short video that I've just recorded on latest v17 Odoo Runbot where I'm trying to create a pricelist with one rule applied on a specific product, with 40% discount, and you'll notice that:
the percent_price is not set with the desired value, but default 0
the product shows up as Unnamed (until I save the pricelist)
if I would have set product variant instead, it would have not been set as well, and when trying to save the pricelist the required field validation warning would have popped up
Impacted versions:
16.0
Steps to reproduce:
in view, define your one2many field and add the default attribute with the default values you want to set:
create a button to open a form with an one2many field and set the values for this field in the context
Current behavior:
Only the fields of one2many occurring in the tree view(
product_name
) can be assigned with the default values.Expected behavior:
All fields in the one2many fields can be assigned
Video/Screenshot link (optional):
Support ticket number submitted via odoo.com/help (optional):
The text was updated successfully, but these errors were encountered: