New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌈 details_model_record field refactor #634
🌈 details_model_record field refactor #634
Conversation
67e56fd
to
c44e655
Compare
@KolushovAlexandr change the version please |
…dr/misc-addons into 11.0-base_details-issue_2
base_details/models/base_details.py
Outdated
details_res_id = fields.Integer(compute="_compute_details", string='Details', store=True) | ||
details_model_exists = fields.Boolean(compute="_compute_details", string='Details Model Exists', store=True) | ||
details_model = fields.Selection(selection="_model_selection", string='Model', store=True) | ||
details_model_record = fields.Reference(selection="_compute_details_model_record", string='Record') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use _compute
prefix for selection
@api.depends('details_model_record') | ||
@api.onchange('details_model_record') | ||
def _compute_details(self): | ||
@api.onchange('details_model_exists', 'details_model_record') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's onchange
and not api.depends
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yelizariev Because it should be updated right on the form
…dr/misc-addons into 11.0-base_details-issue_2
…dr/misc-addons into 11.0-base_details-issue_2
No description provided.