[FIX] sale_timesheet: allow install of demo data
The product `sale_timesheet.product_service_deliver_milestones` uses
`milestones` service_type but this is not available always.
Steps to reproduce issue:
1. Install sale_praject (with demo) in a clean DB
2. Unmark "Use milestones" in settings
3. Set invoice policy at delivery in settings
4. Try to install sale_timesheet
Demo data fails to install due to attempt to use milestores as service
type.
```
File "/home/odoo/src/odoo/16.0/odoo/fields.py", line 2720, in convert_to_cache
raise ValueError("Wrong value for %s: %r" % (self, value))
```
This issue blocks many upgrades.
closes odoo/odoo#116697
X-original-commit: 8ae7bf6c9a3af45353e5ef43d8b72f95c6731e5f
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit is contained in:
@@ -112,7 +112,7 @@
|
||||
<field name="type">service</field>
|
||||
<field name="uom_id" ref="uom.product_uom_unit"/>
|
||||
<field name="uom_po_id" ref="uom.product_uom_unit"/>
|
||||
<field name="service_type">milestones</field>
|
||||
<field name="service_type" model="product.product" eval="'milestones' if obj().env.user.has_group('project.group_project_milestone') else 'manual'" />
|
||||
<field name="service_tracking">task_in_project</field>
|
||||
<field name="project_template_id" ref="so_template_project"/>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user