Files
odoo_source/addons/project/models
Lucas LefèvreandMaxLarue 2dccf4d6cd [IMP] project: Use stored computed fields for parent to children task
Purpose
=======
When you create a task independently and link it to a Parent task later on,
several changes are applied: the person assigned on the sub-task switches
to the one set on the parent task, same for the customer, and so on.
This creates frustration because the user most likely set specific data on the
sub task for a reason. In addition, the changes are made implicitely, so the
user might not notice it or get confused as to what changed from the original
task.

Specification
=============
Values for fields `partner_id`, `email_from`, `project_id`, `sale_line_id` should be
transfered from parent task to children task, only if the value is not already set
on the child.

This was already partially implemented by 749810a and 45396f7.
But to achieve it, similar code was duplicated in several methods:
default_get, onchanges, write, create.

Since the new ORM, the same behavior can be achieved with only computed fields
with store=True and readonly=False. This commit changes the previous implementation
to take advantage of this which greatly improves code readability and maintainability.

Tests by Maximilen Larue
Business code by Lucas Lefèvre

closes odoo/odoo#39369

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: MaxLarue <mla@odoo.com>
2019-10-25 14:22:36 +00:00
..
…