[IMP] sale_{project,timesheet}: add default values for timesheets action

This commit adds some default values for the action used in the SOLs
containing a service product shown in the Sales section.

task-2814466

Part-of: odoo/odoo#88219
This commit is contained in:
Xavier BOL (xbo)
2022-04-08 17:13:30 +02:00
parent 1a32fbd9c9
commit 3fcf7631c9
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -267,7 +267,7 @@ class Project(models.Model):
def get_action(sol_id):
""" Return the action vals to call it in frontend if the user can access to the SO related """
action, res_id = action_per_sol.get(sol_id, (None, None))
return {'action': action, 'res_id': res_id, 'additional_context': json.dumps({'active_id': sol_id})} if action else {}
return {'action': action, 'res_id': res_id, 'additional_context': json.dumps({'active_id': sol_id, 'default_project_id': self.id})} if action else {}
return [{
**sol_read,
@@ -109,6 +109,7 @@
'search_default_billable_timesheet': True,
'search_default_week': 1,
'default_so_line': active_id,
'default_is_so_line_edited': True,
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">