[FIX] website_livechat: add res_config file for configuration of the channel
authorChristophe Matthieu <chm@openerp.com>
Mon, 10 Feb 2014 16:41:13 +0000 (17:41 +0100)
committerChristophe Matthieu <chm@openerp.com>
Mon, 10 Feb 2014 16:41:13 +0000 (17:41 +0100)
bzr revid: chm@openerp.com-20140210164113-41vl0ftlk9eybnlw

addons/website_livechat/__openerp__.py
addons/website_livechat/models/website.py
addons/website_livechat/views/res_config.xml [new file with mode: 0644]
addons/website_livechat/views/website_livechat.xml

index 0ab7781..5220fc4 100644 (file)
@@ -12,10 +12,7 @@ OpenERP Website LiveChat
     'depends': ['website', 'im_livechat'],
     'installable': True,
     'data': [
-        'views/website_livechat.xml'
+        'views/website_livechat.xml',
+        'views/res_config.xml'
     ],
-    'demo': [ ],
-    'js': [],
-    'qweb': [],
-    'css': [],
 }
index 7e86042..3e3df1c 100644 (file)
@@ -5,4 +5,11 @@ class website(osv.osv):
 
     _columns = {
         'channel_id': fields.many2one('im_livechat.channel', string="Channel"),
-    }
\ No newline at end of file
+    }
+
+class website_config_settings(osv.osv_memory):
+    _inherit = 'website.config.settings'
+
+    _columns = {
+        'channel_id': fields.related('website_id', 'channel_id', type='many2one', relation='im_livechat.channel', string='Live Chat Channel'),
+    }
diff --git a/addons/website_livechat/views/res_config.xml b/addons/website_livechat/views/res_config.xml
new file mode 100644 (file)
index 0000000..ac69929
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+    <record id="view_website_config_settings" model="ir.ui.view">
+        <field name="name">Website livechat settings</field>
+        <field name="model">website.config.settings</field>
+        <field name="inherit_id" ref="website.view_website_config_settings"/>
+        <field name="arch" type="xml">
+            <xpath expr="//group[@string='Social Media']" position="inside">
+                <label for="channel_id"/>
+                <div name="channel_id">
+                    <div class="oe_inline">
+                        <field name="channel_id"/>
+                    </div>
+                </div>
+            </xpath>
+        </field>
+    </record>
+
+    </data>
+</openerp>
index d4da07f..374e0d5 100644 (file)
@@ -2,22 +2,6 @@
 <openerp>
     <data>
 
-<record id="website_settings_livechat" model="ir.ui.view">
-    <field name="name">website.form</field>
-    <field name="model">website</field>
-    <field name="inherit_id" ref="website.view_website_form"/>
-    <field name="arch" type="xml">
-        <xpath expr="//div[@name='other']" position='before'>
-            <div name="livechat">
-                <separator string="LiveChat"/>
-                <group name="livechat">
-                    <field name="channel_id" widget="many2one"/>
-                </group>
-            </div>
-        </xpath>
-    </field>
-</record>
-
 <template id="header" inherit_id="website.layout" name="LiveChat Snippet">
     <xpath expr="//body" position="inside">
         <t t-if="website.channel_id">