[ADD,IMP]:gtk contact form
bzr revid: nch@tinyerp.com-20100505091851-lzrd2piensdct79k
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group colspan="8">
|
||||
<field name="charts" colspan="8"/>
|
||||
<field name="charts"/>
|
||||
<group colspan="4" groups="base.group_extended">
|
||||
<separator col="4" colspan="4" string="Install Extra Account Module"/>
|
||||
<field name="account_analytic_plans"/>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from operator import itemgetter
|
||||
|
||||
from osv import osv, fields
|
||||
import netsvc
|
||||
import tools
|
||||
|
||||
class base_gtkcontactform(osv.osv_memory):
|
||||
"""
|
||||
"""
|
||||
_name = 'base.gtkcontactform'
|
||||
_inherit = 'res.config'
|
||||
logger = netsvc.Logger()
|
||||
|
||||
def default_get(self, cr, uid, fields_list=None, context=None):
|
||||
''' set email and phone number selected in the previous company information
|
||||
form '''
|
||||
defaults = super(base_gtkcontactform, self)\
|
||||
.default_get(cr, uid, fields_list=fields_list, context=context)
|
||||
company_id = self.pool.get('base.setup.company').search(cr, uid, [])
|
||||
company = self.pool.get('base.setup.company').read(cr, uid, company_id)[0]
|
||||
defaults.update({'email':company.get('email',''),
|
||||
'phone': company.get('phone','')})
|
||||
return defaults
|
||||
|
||||
_columns = {
|
||||
'name':fields.char('Your Name', size=64, required=True),
|
||||
'job':fields.char('Job Title', size=64,),
|
||||
'email':fields.char('E-mail', size=64, required=True),
|
||||
'phone':fields.char('Phone', size=64, required=True),
|
||||
'total_employees':fields.selection([('1-5','1-5'),('5-20','5-20'),('20-100','20-100'),('100-500','100-500'),('500','500+')], 'No Of Employees', size=32),
|
||||
'industry':fields.selection([('apparel','Apparel'),('banking','Banking'),('biotechnology','Biotechnology'),('chemicals','Chemicals'),('communications','Communications'),
|
||||
('construction','Construction'),('consulting','Consulting'),('education','Education'),('electronics','Electronics'),('energy','Energy'),('engineering','Engineering'),
|
||||
('entertainment','Entertainment'),('environmental','Environmental'),('finance','Finance'),('government','Government'),('healthcare','Healthcare'),('hospitality','Hospitality'),
|
||||
('insurance','Insurance'),('machinery','Machinery'),('manufacturing','Manufacturing'),('media','Media'),('notforprofit','Not For Profit'),
|
||||
('recreation','Recreation'),('retail','Retail'),('shipping','Shipping'),('technology','Technology'),('telecommunications','Telecommunications'),
|
||||
('transportation','Transportation'),('utilities','Utilities'),('other','Other'),
|
||||
], 'Industry', size=32),
|
||||
'use_openerp':fields.boolean('We plan to use OpenERP'),
|
||||
'already_using_openerp':fields.boolean('Already using OpenERP'),
|
||||
'sell_openerp':fields.boolean('Plan to sell OpenERP'),
|
||||
'already_selling__openerp':fields.boolean('Already selling OpenERP'),
|
||||
|
||||
'features':fields.boolean('The features of OpenERP'),
|
||||
'saas':fields.boolean('OpenERP Online Solutions (SaaS)'),
|
||||
'partners_program':fields.boolean('OpenERP Partners Program (for integrators)'),
|
||||
'support':fields.boolean('Support and Maintenance Solutions'),
|
||||
'training':fields.boolean('OpenERP Training Program'),
|
||||
'other':fields.boolean('Other'),
|
||||
'ebook':fields.boolean('ebook'),
|
||||
'updates':fields.boolean('updates'),
|
||||
}
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
pass
|
||||
|
||||
base_gtkcontactform()
|
||||
@@ -0,0 +1,81 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_base_setup_contact" model="ir.ui.view">
|
||||
<field name="name">Contact information</field>
|
||||
<field name="model">base.gtkcontactform</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<form position="attributes">
|
||||
<attribute name="string">Contact Information</attribute>
|
||||
</form>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">Information about you and the company you are related too. The Basic information related to the company has already been collected and some more information required by you to fill.</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="title"]' position='attributes'>
|
||||
<attribute name='string'>About You</attribute>
|
||||
<attribute name='colspan'>4</attribute>
|
||||
</xpath>
|
||||
<xpath expr='//separator[@string="vsep"]' position='attributes'>
|
||||
<attribute name='rowspan'>22</attribute>
|
||||
<attribute name='string'></attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group colspan="4">
|
||||
<group colspan="2">
|
||||
<field name="name" colspan="2" required="True"/>
|
||||
<field name="job" colspan="2"/>
|
||||
<field name="email" colspan="2"/>
|
||||
<field name="phone" colspan="2"/>
|
||||
<field name="total_employees" colspan="2"/>
|
||||
<field name="industry" colspan="2"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="4">
|
||||
<separator string="Your projects with OpenERP" colspan="4"/>
|
||||
<field name="use_openerp" colspan="1"/>
|
||||
<field name="already_using_openerp" colspan="1"/>
|
||||
<field name="sell_openerp" colspan="1"/>
|
||||
<field name="already_selling__openerp" colspan="1"/>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<separator colspan="4" string="You would like to know more about"/>
|
||||
<field name="features" colspan="1"/>
|
||||
<field name="saas" colspan="1"/>
|
||||
<field name="partners_program" colspan="1"/>
|
||||
<field name="support" colspan="1"/>
|
||||
<field name="training" colspan="1"/>
|
||||
<field name="other" colspan="1"/>
|
||||
</group>
|
||||
<group colspan="2">
|
||||
<separator colspan="4" string="Do You Need Them ?"/>
|
||||
<field name="ebook" nolabel="1" colspan="1"/>
|
||||
<label align="0.0" string="I want to receive the Open ERP ebook (PDF) by email." colspan="1"/>
|
||||
<newline/>
|
||||
<field name="updates" nolabel="1" colspan="1"/>
|
||||
<label align="0.0" string="Yes, I would like to receive information updates from OpenERP." colspan="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_base_contact" model="ir.actions.act_window">
|
||||
<field name="name">Setup contact information</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.gtkcontactform</field>
|
||||
<field name="view_id" ref="view_base_setup_contact"/>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
<record id="base_setup_contact_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_base_contact"/>
|
||||
<field name="sequence">1</field>
|
||||
<field name="restart">onskip</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user