|
3 | 3 | # © 2017 Danimar Ribeiro, Trustcode
|
4 | 4 | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
5 | 5 |
|
6 |
| -from odoo import api, fields, models |
| 6 | +from odoo import fields, models |
7 | 7 | from odoo.exceptions import Warning
|
8 | 8 |
|
9 | 9 | # Estágio em que o issue será finalizado pelo cliente
|
10 | 10 | STAGE_ID_CLOSED = 41
|
11 | 11 |
|
12 | 12 |
|
13 |
| -class ProjectIssue(models.Model): |
14 |
| - _inherit = "project.issue" |
15 |
| - |
16 |
| - can_close = fields.Boolean("Pode Fechar?") |
17 |
| - pergunta1 = fields.Selection([('sim', u'Sim'), ('nao', u'Não')]) |
18 |
| - pergunta2 = fields.Selection([('otimo', u'Ótimo'), ('bom', u'Bom'), |
19 |
| - ('regular', u'Regular'), ('ruim', u'Ruim'), |
20 |
| - ('pessimo', u'Péssimo')]) |
21 |
| - pergunta3 = fields.Selection([('otimo', u'Ótimo'), ('bom', u'Bom'), |
22 |
| - ('regular', u'Regular'), ('ruim', u'Ruim'), |
23 |
| - ('pessimo', u'Péssimo')]) |
24 |
| - pergunta4 = fields.Selection([('1', '1'), ('2', '2'), ('3', '3'), |
25 |
| - ('4', '4'), ('5', '5'), ('6', '6'), |
26 |
| - ('7', '7'), ('8', '8'), ('9', '9'), |
27 |
| - ('10', '10')]) |
28 |
| - |
29 |
| - @api.multi |
30 |
| - def write(self, vals): |
31 |
| - res = super(ProjectIssue, self).write(vals) |
32 |
| - if "stage_id" in vals and vals['stage_id'] == 40 and not self.can_close: |
33 |
| - raise Warning(u'Por favor, utilize o botão localizado dentro do \ |
34 |
| - ticket para encerrar o chamado.') |
35 |
| - |
36 |
| - return res |
37 |
| - |
38 |
| - def action_close_issue(self): |
39 |
| - action = self.env.ref( |
40 |
| - 'issue_satisfaction_survey.action_issue_satifaction_survey').read()[0] |
41 |
| - |
42 |
| - return action |
43 |
| - |
44 |
| - |
45 | 13 | class ProjectIssueClose(models.TransientModel):
|
46 | 14 | _name = "project.issue.close"
|
47 | 15 |
|
|
0 commit comments