diff --git a/addons/hr_timesheet/views/hr_timesheet_views.xml b/addons/hr_timesheet/views/hr_timesheet_views.xml index 5419a14179a..9d6a1d296ff 100644 --- a/addons/hr_timesheet/views/hr_timesheet_views.xml +++ b/addons/hr_timesheet/views/hr_timesheet_views.xml @@ -9,8 +9,9 @@ - - + + @@ -123,10 +124,10 @@ - - - + @@ -138,6 +139,7 @@ + @@ -151,8 +153,9 @@ 10 - - + + diff --git a/addons/sale_timesheet/models/account.py b/addons/sale_timesheet/models/account.py index 4b0cae00927..6b14da6a153 100644 --- a/addons/sale_timesheet/models/account.py +++ b/addons/sale_timesheet/models/account.py @@ -168,3 +168,25 @@ class AccountAnalyticLine(models.Model): if mapping_entry: return mapping_entry.cost return super()._hourly_cost() + + def action_sale_order_from_timesheet(self): + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': _('Sale Order'), + 'res_model': 'sale.order', + 'views': [[False, 'form']], + 'context': {'create': False, 'show_sale': True}, + 'res_id': self.order_id.id, + } + + def action_invoice_from_timesheet(self): + self.ensure_one() + return { + 'type': 'ir.actions.act_window', + 'name': _('Invoice'), + 'res_model': 'account.move', + 'views': [[False, 'form']], + 'context': {'create': False}, + 'res_id': self.timesheet_invoice_id.id, + } diff --git a/addons/sale_timesheet/views/hr_timesheet_views.xml b/addons/sale_timesheet/views/hr_timesheet_views.xml index b9b5beb31fe..3cef8f3d2b1 100644 --- a/addons/sale_timesheet/views/hr_timesheet_views.xml +++ b/addons/sale_timesheet/views/hr_timesheet_views.xml @@ -61,6 +61,24 @@ + + + + +
+ + +
+
+