Browse Source

Rename field propose_creation_crm_phonecall to context_propose_creation_crm_call in order to allow modification via the user's preferences.

pull/26/head
Alexis de Lattre 12 years ago
parent
commit
4d246794bf
  1. 9
      asterisk_click2dial_crm/asterisk_click2dial_crm.py
  2. 2
      asterisk_click2dial_crm/i18n/asterisk_click2dial_crm.pot
  3. 2
      asterisk_click2dial_crm/i18n/fr.po
  4. 19
      asterisk_click2dial_crm/res_users_view.xml

9
asterisk_click2dial_crm/asterisk_click2dial_crm.py

@ -50,7 +50,7 @@ class res_partner_address(osv.osv):
'target': 'new',
'context': context,
}
if user.propose_creation_crm_phonecall:
if user.context_propose_creation_crm_call:
return action_start_wizard
else:
return True
@ -62,11 +62,14 @@ class res_users(osv.osv):
_inherit = "res.users"
_columns = {
'propose_creation_crm_phonecall': fields.boolean('Propose to create a call in CRM after a click2dial'),
# Field name starts with 'context_' to allow modification by the user
# in his preferences, cf server-61/openerp/addons/base/res/res_users.py
# line 377 in "def write" of "class users"
'context_propose_creation_crm_call': fields.boolean('Propose to create a call in CRM after a click2dial'),
}
_defaults = {
'propose_creation_crm_phonecall': True,
'context_propose_creation_crm_call': True,
}
res_users()

2
asterisk_click2dial_crm/i18n/asterisk_click2dial_crm.pot

@ -52,7 +52,7 @@ msgid "wizard.create.crm.phonecall"
msgstr ""
#. module: asterisk_click2dial_crm
#: field:res.users,propose_creation_crm_phonecall:0
#: field:res.users,context_propose_creation_crm_call:0
msgid "Propose to create a call in CRM after a click2dial"
msgstr ""

2
asterisk_click2dial_crm/i18n/fr.po

@ -52,7 +52,7 @@ msgid "wizard.create.crm.phonecall"
msgstr "wizard.create.crm.phonecall"
#. module: asterisk_click2dial_crm
#: field:res.users,propose_creation_crm_phonecall:0
#: field:res.users,context_propose_creation_crm_call:0
msgid "Propose to create a call in CRM after a click2dial"
msgstr "Propose de créer un appel dans la CRM après un click2dial"

19
asterisk_click2dial_crm/res_users_view.xml

@ -15,7 +15,24 @@
<field name="inherit_id" ref="asterisk_click2dial.asterisk_res_users_internal_number"/>
<field name="arch" type="xml">
<field name="variable" position="after">
<field name="propose_creation_crm_phonecall"/>
<field name="context_propose_creation_crm_call"/>
</field>
</field>
</record>
<record id="asterisk_crm_preferences_option_view" model="ir.ui.view">
<field name="name">asterisk.crm.preferences.option.view</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" />
<field name="arch" type="xml">
<field name="signature" position="after">
<group colspan="4" col="2" >
<!-- I create a group to avoid that the long "string" of the
field context_propose_creation_crm_call pushes all other fields
to the right -->
<separator string="Telephony preferences" colspan="2"/>
<field name="context_propose_creation_crm_call" readonly="0"/>
</group>
</field>
</field>
</record>

Loading…
Cancel
Save