-
-
Notifications
You must be signed in to change notification settings - Fork 319
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] helpdesk_mgmt_sale: Access tickets from the order
With the widget ‘many2many_tags’ it is not possible to click on a ticket in the order and access the form. By adding a smartbutton it is possible to access the list of tickets in the order and also consult the form for each one of them. TT50683
- Loading branch information
1 parent
72306a8
commit 732e6f9
Showing
4 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
from odoo import fields, models | ||
from odoo import api, fields, models | ||
|
||
|
||
class SaleOrder(models.Model): | ||
_inherit = "sale.order" | ||
|
||
ticket_ids = fields.Many2many("helpdesk.ticket") | ||
ticket_count = fields.Integer( | ||
string="Tickets Count", compute="_compute_ticket_count", store=True | ||
) | ||
|
||
@api.depends("ticket_ids") | ||
def _compute_ticket_count(self): | ||
for order in self: | ||
order.ticket_count = len(order.ticket_ids) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters