From eb1437bfe3417bfc556a6e3a4901520549f75588 Mon Sep 17 00:00:00 2001 From: Raimon Esteve Date: Wed, 13 Jul 2016 12:47:05 +0200 Subject: [PATCH] Remove allowed_contacts_mechanisms field in Work Asterisk Result view --- locale/ca_ES.po | 4 ---- locale/es_ES.po | 4 ---- work.py | 11 +---------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/locale/ca_ES.po b/locale/ca_ES.po index 846eb48..d8413a8 100644 --- a/locale/ca_ES.po +++ b/locale/ca_ES.po @@ -2,10 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "field:project.work.asterisk.result,allowed_contacts_mechanisms:" -msgid "Allowed Contacts Mechanisms" -msgstr "Mitjans de contacte disponibles" - msgctxt "field:project.work.asterisk.result,contact_mechanisms:" msgid "Contact Mechanisms" msgstr "Mitjans de contacte" diff --git a/locale/es_ES.po b/locale/es_ES.po index a300cf1..095160f 100644 --- a/locale/es_ES.po +++ b/locale/es_ES.po @@ -2,10 +2,6 @@ msgid "" msgstr "Content-Type: text/plain; charset=utf-8\n" -msgctxt "field:project.work.asterisk.result,allowed_contacts_mechanisms:" -msgid "Allowed Contacts Mechanisms" -msgstr "Medios de contacto disponibles" - msgctxt "field:project.work.asterisk.result,contact_mechanisms:" msgid "Contact Mechanisms" msgstr "Medios de contacto" diff --git a/work.py b/work.py index ff810ec..329d59e 100644 --- a/work.py +++ b/work.py @@ -4,7 +4,6 @@ from trytond.model import ModelView, fields from trytond.pool import Pool from trytond.transaction import Transaction -from trytond.pyson import Eval from trytond.wizard import Wizard, StateView, StateTransition, Button __all__ = ['WorkAsteriskResult', 'WorkAsterisk'] @@ -15,15 +14,8 @@ class WorkAsteriskResult(ModelView): __name__ = 'project.work.asterisk.result' phone = fields.Selection('get_phones', 'Phone', required=True) - allowed_contacts_mechanisms = fields.Function(fields.One2Many( - 'party.contact_mechanism', None, 'Allowed Contacts Mechanisms'), - 'on_change_with_allowed_contacts_mechanisms') contact_mechanisms = fields.Many2One('party.contact_mechanism', - 'Contact Mechanisms', - domain=[ - ('id', 'in', Eval('allowed_contacts_mechanisms', [])), - ], - depends=['allowed_contacts_mechanisms']) + 'Contact Mechanisms') class WorkAsterisk(Wizard): @@ -66,7 +58,6 @@ class WorkAsterisk(Wizard): mechanisms.extend(self.get_mechanims(contact)) mechanisms = list(set(mechanisms)) return { - 'allowed_contacts_mechanisms': [m.id for m in mechanisms], 'contact_mechanisms': mechanisms and mechanisms[0].id or None }