bzr revid: chs@tinyerp.com-20100112160341-uloolawazbybx01w
This commit is contained in:
Christophe Simonis 2010-01-12 17:03:41 +01:00
commit 74b7f573ea
26 changed files with 474 additions and 700 deletions

View File

@ -1716,21 +1716,28 @@ account_subscription_line()
class account_config_wizard(osv.osv_memory):
_name = 'account.config.wizard'
_inherit = 'res.config'
def _get_charts(self, cr, uid, context):
module_obj=self.pool.get('ir.module.module')
ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'), ('state', '<>', 'installed')])
ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'),
('state', '<>', 'installed')])
res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)]
res.append((-1, 'None'))
res.sort(key=lambda x: x[1])
return res
_columns = {
'name':fields.char('Name', required=True, size=64, help="Name of the fiscal year as displayed on screens."),
'code':fields.char('Code', required=True, size=64, help="Name of the fiscal year as displayed in reports."),
'name':fields.char(
'Name', required=True, size=64,
help="Name of the fiscal year as displayed on screens."),
'code':fields.char(
'Code', required=True, size=64,
help="Name of the fiscal year as displayed in reports."),
'date1': fields.date('Start Date', required=True),
'date2': fields.date('End Date', required=True),
'period':fields.selection([('month','Month'),('3months','3 Months')], 'Periods', required=True),
'period':fields.selection([('month','Month'), ('3months','3 Months')],
'Periods', required=True),
'charts' : fields.selection(_get_charts, 'Charts of Account',required=True)
}
_defaults = {
@ -1740,15 +1747,6 @@ class account_config_wizard(osv.osv_memory):
'date2': lambda *a: time.strftime('%Y-12-31'),
'period':lambda *a:'month',
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def install_account_chart(self, cr, uid, ids, context=None):
for res in self.read(cr,uid,ids):
chart_id = res['charts']
@ -1758,7 +1756,7 @@ class account_config_wizard(osv.osv_memory):
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
def action_create(self, cr, uid,ids, context=None):
def execute(self, cr, uid, ids, context=None):
for res in self.read(cr,uid,ids):
if 'date1' in res and 'date2' in res:
res_obj = self.pool.get('account.fiscalyear')
@ -1777,16 +1775,6 @@ class account_config_wizard(osv.osv_memory):
elif res['period']=='3months':
res_obj.create_period3(cr,uid,[new_id])
self.install_account_chart(cr,uid,ids)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
account_config_wizard()
@ -2125,6 +2113,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
* generates all accounting properties and assigns them correctly
"""
_name='wizard.multi.charts.accounts'
_inherit = 'res.config'
_columns = {
'company_id':fields.many2one('res.company','Company',required=True),
@ -2145,7 +2134,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'code_digits': lambda *a:6,
}
def action_create(self, cr, uid, ids, context=None):
def execute(self, cr, uid, ids, context=None):
obj_multi = self.browse(cr,uid,ids[0])
obj_acc = self.pool.get('account.account')
obj_acc_tax = self.pool.get('account.tax')
@ -2408,24 +2397,6 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'position_id' : new_fp,
}
obj_ac_fp.create(cr, uid, vals_acc)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
wizard_multi_charts_accounts()
class account_bank_accounts_wizard(osv.osv_memory):

View File

@ -1447,8 +1447,13 @@
<field name="name">Account Configure wizard</field>
<field name="model">account.config.wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Account Configure">
<data>
<form position="attributes"><attribute name="string">
Account Configure
</attribute></form>
<group string="res_config_contents" position="replace">
<separator col="4" colspan="4" string="Create a Fiscal Year"/>
<field name="name"/>
<field name="code"/>
@ -1457,13 +1462,9 @@
<field name="period" colspan="4"/>
<separator col="4" colspan="4" string="Select Chart of Accounts"/>
<field name="charts"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" string="Skip" name="action_cancel" type="object"/>
<button icon="gtk-ok" name="action_create" string="Continue" type="object"/>
</group>
</form>
</group>
<xpath expr='//button[@name="action_skip"]' position="replace"/>
</data>
</field>
</record>
@ -1471,11 +1472,16 @@
<field name="name">Account Configure Wizard </field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.config.wizard</field>
<field name="view_id" ref="view_account_config_wizard_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!-- register configuration wizard -->
<record id="config_fiscalyear" model="ir.actions.todo">
<field name="action_id" ref="action_account_config_wizard_form"/>
</record>
<record id="view_account_addtmpl_wizard_form" model="ir.ui.view">
<field name="name">Account Add wizard</field>
@ -1500,16 +1506,6 @@
src_model="account.account.template"
view_type="form" view_mode="form"/>
<!-- register configuration wizard -->
<record id="config_fiscalyear" model="ir.actions.todo">
<field name="name">Account Configure Wizard</field>
<field name="note">Define Fiscal Years and Select Charts of Account</field>
<field name="action_id" ref="action_account_config_wizard_form"/>
</record>
<!-- Account Templates -->
<menuitem
id="account_template_folder"
@ -1732,31 +1728,38 @@
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="model">wizard.multi.charts.accounts</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Generate Chart of Accounts from a Chart Template">
<separator col="4" colspan="4" string="Generate Chart of Accounts from a Chart Template"/>
<label align="0.0" string="This will automatically configure your chart of accounts, bank accounts, taxes and journals according to the selected template" colspan="4"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name ="code_digits" />
<field name="chart_template_id"/>
<field name ="seq_journal" />
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</tree>
</field>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" type="object" name="action_cancel" string="Cancel"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Generate Chart of Accounts from a Chart Template
</attribute></form>
<group string="res_config_contents" position="replace">
<separator col="4" colspan="4" string="
Generate Chart of Accounts from a Chart Template"/>
<label align="0.0" colspan="4" string="
This will automatically configure your chart of accounts,
bank accounts, taxes and journals according to the selected
template"/>
<field name="company_id" widget="selection"
groups="base.group_multi_company"/>
<field name ="code_digits" />
<field name="chart_template_id"/>
<field name ="seq_journal" />
<field colspan="4" mode="tree" name="bank_accounts_id"
nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</form>
<tree editable="bottom" string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
</tree>
</field>
</group>
<xpath expr='//button[@name="action_skip"]' position='replace'/>
</data>
</field>
</record>
@ -1764,6 +1767,7 @@
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.multi.charts.accounts</field>
<field name="view_id" ref="view_wizard_multi_chart"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>

View File

@ -42,10 +42,10 @@ class company_setup(osv.osv_memory):
* Insert a suitable message for Overdue Payment Report.
"""
_name='wizard.company.setup'
_inherit = 'res.config'
_columns = {
'company_id':fields.many2one('res.company','Company',required=True),
'partner_id':fields.many2one('res.partner','Partner'),
'overdue_msg': fields.text('Overdue Payment Message'),
}
def get_message(self,cr,uid,context={}):
@ -57,42 +57,28 @@ class company_setup(osv.osv_memory):
_defaults = {
'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.id,
'partner_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr,uid,[uid],c)[0].company_id.partner_id.id,
'overdue_msg': get_message,
}
def onchange_company_id(self, cr, uid, ids, company, context=None):
res = {}
if not company:
return {}
comp_obj = self.pool.get('res.company').browse(cr,uid,company)
res['partner_id'] = comp_obj.partner_id.id
phone = comp_obj.partner_id.address and (comp_obj.partner_id.address[0].phone and ' at ' + str(comp_obj.partner_id.address[0].phone) + '.' or '.') or '.'
res['overdue_msg'] = comp_obj.overdue_msg + str(phone)
return {'value': res }
partner_address = comp_obj.partner_id.address
if partner_address and partner_address[0].phone:
msg_tail = ' at %s.'%(partner_address[0].phone)
else:
msg_tail = '.'
def action_create(self, cr, uid, ids, context=None):
content_wiz = self.pool.get('wizard.company.setup').read(cr,uid,ids,['company_id','overdue_msg'])
return {'value': {'overdue_msg': comp_obj.overdue_msg + msg_tail } }
def execute(self, cr, uid, ids, context=None):
content_wiz = self.pool.get('wizard.company.setup')\
.read(cr,uid,ids,['company_id','overdue_msg'])
if content_wiz:
wiz_data = content_wiz[0]
self.pool.get('res.company').write(cr, uid, [wiz_data['company_id']], {'overdue_msg':wiz_data['overdue_msg']})
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
self.pool.get('res.company').write(
cr, uid,
[wiz_data['company_id']],
{'overdue_msg':wiz_data['overdue_msg']})
company_setup()

View File

@ -22,17 +22,21 @@
<field name="name">wizard.company.setup.form</field>
<field name="model">wizard.company.setup</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Overdue Payment Report Message">
<field name="company_id" select="1" on_change="onchange_company_id(company_id)" groups="base.group_multi_company"/>
<field name="partner_id" select="1" readonly="1"/>
<data>
<form position="attributes"><attribute name="string">
Overdue Payment Report Message
</attribute></form>
<group string="res_config_contents" position="replace">
<field name="company_id" select="1"
on_change="onchange_company_id(company_id)"
groups="base.group_multi_company"/>
<separator string="Message" colspan="4"/>
<field name="overdue_msg" nolabel="1" colspan="4"/>
<group col="2" colspan="4">
<button icon="gtk-cancel" special="cancel" type="object" name="action_cancel" string="Cancel"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
</form>
</group>
<xpath expr='//button[@name="action_skip"]' position='replace'/>
</data>
</field>
</record>
@ -40,6 +44,7 @@
<field name="name">Overdue Payment Report Message</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">wizard.company.setup</field>
<field name="view_id" ref="wizard_company_setup_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
@ -48,8 +53,6 @@
<!-- register configuration wizard -->
<record id="config_wizard_account_base_setup_form" model="ir.actions.todo">
<field name="name">Overdue Payment Report Message</field>
<field name="note">Specify The Message for the Overdue Payment Report.</field>
<field name="action_id" ref="action_wizard_company_setup_form"/>
</record>
</data>

View File

@ -241,8 +241,9 @@ class wizard_base_setup(wizard.interface):
return 'charts'
def _config(self, cr, uid, data, context=None):
users_obj=pooler.get_pool(cr.dbname).get('res.users')
action_obj=pooler.get_pool(cr.dbname).get('ir.actions.act_window')
pool = pooler.get_pool(cr.dbname)
users_obj=pool.get('res.users')
action_obj=pool.get('ir.actions.act_window')
ids=action_obj.search(cr, uid, [('name', '=', 'Menu')])
menu=action_obj.browse(cr, uid, ids)[0]
@ -251,14 +252,8 @@ class wizard_base_setup(wizard.interface):
users_obj.write(cr, uid, ids, {'action_id': menu.id})
ids=users_obj.search(cr, uid, [('menu_id', '=', 'Setup')])
users_obj.write(cr, uid, ids, {'menu_id': menu.id})
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'context':{'menu':True},
'target':'new',
}
return pool.get('res.config').next(cr, uid, [], context=context)
fields={
'profile':{

View File

@ -118,18 +118,33 @@ crm_cases()
class crm_menu_config_wizard(osv.osv_memory):
_name = 'crm.menu.config_wizard'
_inherit = 'res.config'
_columns = {
'name': fields.char('Name', size=64),
'meeting': fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."),
'lead': fields.boolean('Leads', help="Allows you to track and manage leads which are pre-sales requests or contacts, the very first contact with a customer request."),
'opportunity': fields.boolean('Business Opportunities', help="Tracks identified business opportunities for your sales pipeline."),
'jobs': fields.boolean('Jobs Hiring Process', help="Helps you to organise the jobs hiring process: evaluation, meetings, email integration..."),
'document_ics': fields.boolean('Shared Calendar', help=" Will allow you to synchronise your Open ERP calendars with your phone, outlook, Sunbird, ical, ..."),
'bugs': fields.boolean('Bug Tracking', help="Used by companies to track bugs and support requests on software"),
'helpdesk': fields.boolean('Helpdesk', help="Manages an Helpdesk service."),
'fund': fields.boolean('Fund Raising Operations', help="This may help associations in their fund raising process and tracking."),
'claims': fields.boolean('Claims', help="Manages the supplier and customers claims, including your corrective or preventive actions."),
'phonecall': fields.boolean('Phone Calls', help="Helps you to encode the result of a phone call or to plan a list of phone calls to process."),
'meeting': fields.boolean('Meetings Calendar',
help="Manages each user's meetings calendar"),
'lead': fields.boolean('Leads', help="Tracks and manages leads"),
'opportunity': fields.boolean('Business Opportunities',
help="Tracks identified business opportunities"),
'jobs': fields.boolean('Jobs Hiring Process',
help="Helps you organise your hiring process (evaluation, "\
"meetings, email integration...)"),
'document_ics': fields.boolean('Shared Calendar',
help="Lets you use your OpenERP calendars in third-party systems "\
"(smartphones, Microsoft Outlook, iCal, Google Calendar..."),
'bugs': fields.boolean('Bug Tracking',
help="Track bugs and support requests on software"),
'helpdesk': fields.boolean('Helpdesk',
help="Manages an Helpdesk service."),
'fund': fields.boolean('Fund Raising Operations',
help="Provides processing and tracking for fund raisings"),
'claims': fields.boolean('Claims',
help="Manages supplier and customers claims, including "\
"corrective or preventive actions"),
'phonecall': fields.boolean('Phone Calls',
help="Lets users encode phone call outcomes or phone calls to "\
"perform"),
}
_defaults = {
'meeting': lambda *args: True,
@ -137,29 +152,28 @@ class crm_menu_config_wizard(osv.osv_memory):
'phonecall': lambda *args: True,
}
def action_create(self, cr, uid, ids, context=None):
module_proxy = self.pool.get('ir.module.module')
modid = module_proxy.search(cr, uid, [('name', '=', 'crm')])
moddemo = module_proxy.browse(cr, uid, modid[0]).demo
def execute(self, cr, uid, ids, context=None):
modobj = self.pool.get('ir.module.module')
modids = modobj.search(cr, uid, [('name', '=', 'crm')])
moddemo = modobj.browse(cr, uid, modids[0]).demo
lst = ('data', 'menu')
if moddemo:
lst = ('data', 'menu', 'demo')
res = self.read(cr, uid, ids)[0]
idref = {}
for section in ['meeting', 'lead', 'opportunity', 'jobs', 'bugs', 'fund', 'helpdesk', 'claims', 'phonecall']:
if (not res[section]):
continue
for fname in lst:
file_name = 'crm_' + section + '_' + fname + '.xml'
file_name = 'crm_%s_%s.xml'%(section, fname)
try:
fp = tools.file_open(os.path.join('crm', file_name))
except IOError, e:
fp = None
if fp:
tools.convert_xml_import(cr, 'crm', fp, idref, 'init', noupdate=True)
tools.convert_xml_import(
cr, 'crm',
tools.file_open(os.path.join('crm', file_name)),
{}, 'init', noupdate=True)
except IOError:
pass
cr.commit()
modobj = self.pool.get('ir.module.module')
modids = modobj.search(cr, uid, [('name', '=', 'crm')])
modobj.update_translations(cr, 1, modids, None)
if res['document_ics']:
@ -167,24 +181,6 @@ class crm_menu_config_wizard(osv.osv_memory):
module_proxy.button_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
}
def action_cancel(self, cr, uid, ids, context=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
}
crm_menu_config_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -28,11 +28,14 @@ import urlparse
import os
class document_configuration_wizard(osv.osv_memory):
_name='document.configuration.wizard'
_rec_name = 'Auto Directory configuration'
_description = 'Auto Directory configuration'
_inherit = 'res.config'
_rec_name = 'host'
_columns = {
'host': fields.char('Server Address', size=64, help="Put here the server address or IP. " \
"Keep localhost if you don't know what to write.", required=True)
'host': fields.char('Address', size=64,
help="Server address or IP.", required=True),
}
def detect_ip_addr(self, cr, uid, context=None):
@ -73,16 +76,7 @@ class document_configuration_wizard(osv.osv_memory):
'host': detect_ip_addr,
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_config(self, cr, uid, ids, context=None):
def execute(self, cr, uid, ids, context=None):
conf = self.browse(cr, uid, ids[0], context)
obj=self.pool.get('document.directory')
objid=self.pool.get('ir.model.data')
@ -152,12 +146,4 @@ class document_configuration_wizard(osv.osv_memory):
aid = objid._get_id(cr, uid, 'document_ftp', 'action_document_browse')
aid = objid.browse(cr, uid, aid, context=context).res_id
self.pool.get('ir.actions.url').write(cr, uid, [aid], {'url': 'ftp://'+(conf.host or 'localhost')+':8021/'})
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
}
document_configuration_wizard()

View File

@ -1,5 +1,5 @@
<openerp>
<data>
<data>
<record model="ir.actions.url" id="action_document_browse">
<field name="name">Browse Files</field>
<field name="url">ftp://localhost:8021/</field>
@ -12,25 +12,26 @@
icon="STOCK_EXECUTE"
parent="document.menu_document"/>
<record id="view_auto_config_form" model="ir.ui.view">
<field name="name">Auto Configure Directory</field>
<field name="model">document.configuration.wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Auto Configure">
<separator string="Document Management System." colspan="4"/>
<label string="This wizard will automatically configure the document management system according to modules installed on your system." align="0.0" colspan="4"/>
<field name="host" colspan="4"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Auto Configure
</attribute></form>
<group string="res_config_contents" position="replace">
<separator string="FTP Server Configuration." colspan="4"/>
<label align="0.0" colspan="4"
string="Choose the address and port for the Document
Management System's FTP server."/>
<field name="host"/>
<field name="port"/>
</group>
<xpath expr='//button[@name="action_skip"]' position="replace"/>
</data>
</field>
</record>
@ -38,19 +39,15 @@
<field name="name">Auto Configure Directory</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.configuration.wizard</field>
<field name="view_id" ref="view_auto_config_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo" id="config_auto_directory">
<field name="name">Auto Configure Directory</field>
<field name="note">This wizard will configure the URL of the server of the document management system.</field>
<field name="action_id" ref="action_config_auto_directory"/>
</record>
</data>
</data>
</openerp>

View File

@ -50,6 +50,8 @@ ICS_TAGS = {
class document_ics_crm_wizard(osv.osv_memory):
_name='document.ics.crm.wizard'
_inherit = 'res.config'
_columns = {
'name':fields.char('Name', size=64),
'meeting' : fields.boolean('Calendar of Meetings', help="Manages the calendar of meetings of the users."),
@ -69,7 +71,7 @@ class document_ics_crm_wizard(osv.osv_memory):
'phonecall': lambda *args: True,
}
def action_create(self, cr, uid, ids, context=None):
def execute(self, cr, uid, ids, context=None):
data=self.read(cr, uid, ids, [])[0]
dir_obj = self.pool.get('document.directory')
dir_cont_obj = self.pool.get('document.directory.content')
@ -79,16 +81,12 @@ class document_ics_crm_wizard(osv.osv_memory):
else:
dir_id = dir_obj.create(cr, uid, {'name': 'Calendars' ,'user_id' : uid, 'type': 'directory'})
for section in ['meeting', 'lead', 'opportunity', 'jobs', 'bugs', 'fund', 'helpdesk', 'claims', 'phonecall']:
if (not data[section]):
continue
else:
if data[section]:
section_id=self.pool.get('crm.case.section').search(cr, uid, [('name', '=', SECTION_NAME[section])])
if not section_id:
continue
else:
if section_id:
object_id=self.pool.get('ir.model').search(cr, uid, [('name', '=', 'Case')])[0]
vals_cont={
vals_cont = {
'name': SECTION_NAME[section],
'sequence': 1,
'directory_id': dir_id,
@ -104,29 +102,12 @@ class document_ics_crm_wizard(osv.osv_memory):
ics_obj=self.pool.get('document.directory.ics.fields')
for tag in ['description', 'url', 'summary', 'dtstart', 'dtend', 'uid']:
field_id = self.pool.get('ir.model.fields').search(cr, uid, [('model_id.name', '=', 'Case'), ('field_description', '=', ICS_TAGS[tag])])[0]
vals_ics={
'field_id': field_id ,
'name': tag ,
'content_id': content_id ,
}
vals_ics = {
'field_id': field_id ,
'name': tag ,
'content_id': content_id ,
}
ics_obj.create(cr, uid, vals_ics)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_cancel(self, cr, uid, ids, conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
document_ics_crm_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,30 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_document_ics_config_directories" model="ir.ui.view">
<record id="view_document_ics_config_directories" model="ir.ui.view">
<field name="name">Configure Calendars for Sections</field>
<field name="model">document.ics.crm.wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Configure Calendars for CRM Sections">
<separator colspan="4" string="Create Pre-Configured Calendars"/>
<newline/>
<field name="meeting"/>
<field name="opportunity"/>
<field name="phonecall"/>
<field name="lead"/>
<field name="claims"/>
<field name="bugs"/>
<field name="helpdesk"/>
<field name="jobs"/>
<field name="fund"/>
<newline/>
<group col="4" colspan="4">
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
<button icon="gtk-go-forward" name="action_create" string="Next" type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Configure Calendars for CRM Sections
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
OpenERP can create and pre-configure a series of integrated
calendar for you."/>
<separator string="Create Pre-Configured Calendars"
colspan="4"/>
<newline/>
<field name="meeting"/>
<field name="opportunity"/>
<field name="phonecall"/>
<field name="lead"/>
<field name="claims"/>
<field name="bugs"/>
<field name="helpdesk"/>
<field name="jobs"/>
<field name="fund"/>
</group>
<xpath expr='//button[@name="action_skip"]'
position='replace'/>
</data>
</field>
</record>
@ -32,19 +38,16 @@
<field name="name">Configure Calendars for Sections </field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">document.ics.crm.wizard</field>
<field name="view_id" ref="view_document_ics_config_directories"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<!-- register configuration wizard -->
<record id="config_wizard_step_case_section_menu" model="ir.actions.todo">
<field name="name">Create Calendars for CRM Case Section</field>
<field name="note">This Configuration step use to create Calendars in document for all Case Sections</field>
<field name="action_id" ref="action_view_document_ics_config_directories"/>
</record>
</data>
</data>
</openerp>

View File

@ -49,9 +49,6 @@
id="partner_intra_vat_menu"/>
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
</record>

View File

@ -4,41 +4,45 @@
<field name="name">account.journal.todo.form</field>
<field name="model">account.journal.todo</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Account Journal">
<group colspan="4" col="6">
<field name="name" select="1"/>
</group>
<separator colspan="4" string="The accounts linked to the account journals"/>
<field name="default_credit_account_id"
on_change="on_change_credit(name, default_credit_account_id)" select="1"/>
<field name="default_debit_account_id"
on_change="on_change_debit(name, default_debit_account_id)" select="1"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" name="action_cancel" string="Cancel" type="object"/>
<button icon="gtk-ok" name="action_new" string="Next" type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Account Journal
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Set accounts on financial journals defined by CamptoCamp
l10n_ch module"/>
<separator colspan="4"/>
<group colspan="4" col="6">
<field name="name" select="1"/>
</group>
<separator colspan="4" string="
The accounts linked to the account journals"/>
<field name="default_credit_account_id" select="1"
on_change="on_change_credit(name, default_credit_account_id)"/>
<field name="default_debit_account_id" select="1"
on_change="on_change_debit(name, default_debit_account_id)"/>
</group>
<xpath expr="//button[@name='action_next']" position="attributes">
<attribute name="string">Next</attribute>
</xpath>
</data>
</field>
</record>
<record id="action_config_journal" model="ir.actions.act_window">
<field name="name">Configure Journal</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.journal.todo</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_journal_form_todo"/>
<field name="target">new</field>
<record id="action_config_journal" model="ir.actions.act_window">
<field name="name">Finalize your Journal</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.journal.todo</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_account_journal_form_todo"/>
<field name="target">new</field>
</record>
<record id="action_config_journal_todo" model="ir.actions.todo">
<field name="name">Finalize your journal</field>
<field name="note">Set accounts on financial journals defined by
Camptocamp l10n_ch module</field>
<field name="action_id" ref="action_config_journal"/>
<field name="sequence">5</field>
<field name="action_id" ref="action_config_journal"/>
<field name="sequence">5</field>
</record>
</data>
</openerp>

View File

@ -31,14 +31,11 @@
##############################################################################
from osv import fields, osv
class Journal(osv.osv):
class Journal(osv.osv_memory):
"""Create account.journal.todo in order to add configuration wizzard"""
_name ="account.journal.todo"
_inherit = 'res.config'
def _get_journal(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
self._inner_steps = 0
@ -47,36 +44,30 @@ class Journal(osv.osv):
return False
return ids[self._inner_steps]
def _get_debit(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
self._inner_steps = 0
if self._inner_steps == 'done' :
return False
ids = self.pool.get('account.journal').search(cr,uid,[])
id = self.pool.get('account.journal').browse(
return self.pool.get('account.journal').browse(
cr,
uid,
ids[self._inner_steps]
).default_debit_account_id.id
return id
def _get_credit(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
self._inner_steps = 0
if self._inner_steps == 'done' :
return False
ids = self.pool.get('account.journal').search(cr,uid,[])
id = self.pool.get('account.journal').browse(
return self.pool.get('account.journal').browse(
cr,
uid,
ids[self._inner_steps]
).default_credit_account_id.id
return id
_columns={
'name': fields.many2one(
'account.journal',
@ -107,61 +98,32 @@ class Journal(osv.osv):
def on_change_debit(self, cr, uid, id, journal, account) :
if account :
self.pool.get('account.journal').write(
cr,
uid,
journal,
vals={
'default_debit_account_id': account,
}
)
cr, uid, journal,
vals={'default_debit_account_id': account,}
)
return {}
def on_change_credit(self, cr, uid, id, journal, account) :
if account :
self.pool.get('account.journal').write(
cr,
uid,
journal,
vals={
'default_credit_account_id': account,
}
)
cr, uid, journal,
vals={'default_credit_account_id': account,}
)
return {}
def action_cancel(self,cr,uid,ids,context=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_new(self,cr,uid,ids,context={}):
def execute(self,cr,uid,ids,context=None):
jids = self.pool.get('account.journal').search(cr, uid, [])
if self._inner_steps < len(jids)-1 :
if self._inner_steps < len(jids)-1:
self._inner_steps += 1
else :
print 'DONE'
self._inner_steps = 'done'
return {
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'account.journal.todo',
'view_id':self.pool.get('ir.ui.view').search(
cr,
uid,
[('name','=','view_account_journal_form_todo')]
),
'view_id': self.pool.get('ir.ui.view')\
.search(cr, uid, [('name','=','account.journal.todo.form')]),
'type': 'ir.actions.act_window',
'target':'new',
}
'target': 'new',
}
Journal()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -11,38 +11,38 @@
<field name="name">account.tax.template.todo</field>
<field name="model">account.tax.template.todo</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Account tax template">
<group colspan="4" col="6">
<field name="name" select="1"/>
</group>
<separator colspan="4" string="The accounts linked to the tax template"/>
<field name="account_collected_id"
on_change="on_change_collected(name, account_collected_id)" select="1"/>
<field name="account_paid_id"
on_change="on_change_paid(name, account_paid_id)" select="1"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" name="action_cancel" string="Cancel" type="object"/>
<button icon="gtk-ok" name="action_new" string="Next" type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Account tax template
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Set account on financial taxes defined by
Camptocamp l10n_ch_c2c_pcg module"/>
<group colspan="4" col="6">
<field name="name" select="1"/>
</group>
<separator colspan="4" string="The accounts linked to the tax template"/>
<field name="account_collected_id"
on_change="on_change_collected(name, account_collected_id)" select="1"/>
<field name="account_paid_id"
on_change="on_change_paid(name, account_paid_id)" select="1"/>
</group>
</data>
</field>
</record>
<record id="action_config_tax" model="ir.actions.act_window">
<field name="name">Configure Journal</field>
<record id="action_config_tax" model="ir.actions.act_window">
<field name="name">Finalize your tax configuration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">account.tax.template.todo</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="view_tax_template_form_todo"/>
<field name="view_id" ref="view_tax_template_form_todo"/>
<field name="target">new</field>
</record>
<record id="action_config_tax_todo" model="ir.actions.todo">
<field name="name">Finalize your tax configuration</field>
<field name="note">Set account on financial taxes defined by
Camptocamp l10n_ch_c2c_pcg module</field>
<field name="action_id" ref="action_config_tax"/>
<field name="sequence">5</field>
</record>

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2.3
#!/usr/bin/env python
#
# config.py
#
@ -7,54 +7,36 @@
#
from osv import fields, osv
class Tax_template(osv.osv):
"""Creat account.journal.todo class in order
class Tax_template(osv.osv_memory):
"""Creat account.journal.todo class in order
to add configuration wizzard"""
_name ="account.tax.template.todo"
def _get_tax(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
_inherit = 'res.config'
def _ensure_step(self):
if getattr(self, '_inner_steps', None) is None:
self._inner_steps = 0
def _current_tax_template(self, cr, uid):
ids = self.pool.get('account.tax.template').search(cr,uid,[])
if self._inner_steps == 'done' :
return False
return ids[self._inner_steps]
return self.pool.get('account.tax.template').browse(
cr, uid, ids[self._inner_steps]
)
def _get_tax(self, cr, uid, ctx):
self._ensure_step()
return self.pool.get('account.tax.template')\
.search(cr,uid,[])[self._inner_steps]
def _get_collected(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
self._inner_steps = 0
if self._inner_steps == 'done' :
return False
ids = self.pool.get('account.tax.template').search(cr,uid,[])
id = self.pool.get('account.tax.template').browse(
cr,
uid,
ids[self._inner_steps]
).account_collected_id.id
return id
self._ensure_step()
return self._current_tax_template(cr, uid).account_collected_id.id
def _get_paid(self, cr, uid, ctx):
if not self.__dict__.has_key('_inner_steps') :
self._inner_steps = 0
if self._inner_steps == 'done' :
return False
ids = self.pool.get('account.tax.template').search(cr,uid,[])
id = self.pool.get('account.tax.template').browse(
cr,
uid,
ids[self._inner_steps]
).account_paid_id.id
return id
_columns={
self._ensure_step()
return self._current_tax_template(cr, uid).account_paid_id.id
_columns = {
'name': fields.many2one(
'account.tax.template',
'Tax to set',
@ -62,84 +44,50 @@ class Tax_template(osv.osv):
help="The tax template you are currently editing"
),
'account_collected_id':fields.many2one(
'account.account.template',
'Invoice Tax Account',
help="You can set \
here the invoice tax account"
),
'account.account.template',
'Invoice Tax Account',
help="You can set here the invoice tax account"
),
'account_paid_id':fields.many2one(
'account.account.template',
'Refund Tax Account',
help="You can set \
here the refund tax account"
),
}
'account.account.template',
'Refund Tax Account',
help="You can set here the refund tax account"
),
}
_defaults = {
'name': _get_tax,
'account_collected_id':_get_collected,
'account_paid_id':_get_paid,
'account_collected_id': _get_collected,
'account_paid_id': _get_paid,
}
def on_change_collected(self, cr, uid, id, tax, account) :
if account :
def _on_change(self, cr, uid, id, tax, vals):
if account:
self.pool.get('account.tax.template').write(
cr,
uid,
tax,
vals={
'account_collected_id': account,
}
)
return {}
def on_change_paid(self, cr, uid, id, tax, account) :
if account :
self.pool.get('account.tax.template').write(
cr,
uid,
tax,
vals={
'account_paid_id': account,
}
)
cr, uid, tax, vals=vals)
return {}
def on_change_collected(self, cr, uid, id, tax, account):
return self._on_change(
cr, uid, ids, tax, vals={'account_collected_id': account})
def on_change_paid(self, cr, uid, id, tax, account):
return self._on_change(
cr, uid, ids, tax, vals={'account_paid_id': account})
def action_cancel(self,cr,uid,ids,context=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_new(self,cr,uid,ids,context={}):
def execute(self,cr,uid,ids,context={}):
jids = self.pool.get('account.tax.template').search(cr, uid, [])
if self._inner_steps < len(jids)-1 :
self._inner_steps += 1
else :
self._inner_steps = 'done'
return {
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'account.tax.template.todo',
'view_id':self.pool.get('ir.ui.view').search(
cr,
uid,
[('name','=','view_account_journal_form_todo')]
),
cr, uid, [('name','=','account.tax.template.todo')]),
'type': 'ir.actions.act_window',
'target':'new',
}
}
Tax_template()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -3,9 +3,6 @@
<data>
<record id="config_call_account_template" model="ir.actions.todo">
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="note">Generate Chart of Accounts from a Chart Template. You will be asked to select the company, the chart template, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated.
This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template.</field>
<field name="action_id" ref="account.action_wizard_multi_chart"/>
</record>

View File

@ -24,6 +24,8 @@ import pooler
class profile_accounting_config_install_modules_wizard(osv.osv_memory):
_name='profile.accounting.config.install_modules_wizard'
_inherit = 'res.config'
_columns = {
'name':fields.char('Name', size=64),
'account_analytic_analysis':fields.boolean('Analytic Accounting'),
@ -33,38 +35,18 @@ class profile_accounting_config_install_modules_wizard(osv.osv_memory):
'hr_timesheet_invoice':fields.boolean('Invoice on Analytic Entries'),
'account_budget':fields.boolean('Budgets', help="Helps you to manage financial and analytic budgets."),
'board_document':fields.boolean('Document Management',help= "The Document Management System of Open ERP allows you to store, browse, automatically index, search and preview all kind of documents (internal documents, printed reports, calendar system). It opens an FTP access for the users to easily browse association's document."),
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
def execute(self, cr, uid, ids, context=None):
result = self.read(cr, uid, ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
if r != 'id' and res[r]:
ids += mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.button_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname,update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
profile_accounting_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,25 +5,29 @@
<field name="name">Accounting Profile : Install extra modules</field>
<field name="model">profile.accounting.config.install_modules_wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Accounting Management" colspan="4"/>
<field name="account_analytic_analysis"/>
<field name="account_analytic_plans"/>
<field name="account_payment"/>
<separator string="Resources Management" colspan="4"/>
<field name="account_budget"/>
<field name="account_asset"/>
<separator string="Services Management" colspan="4"/>
<field name="hr_timesheet_invoice"/>
<field name="board_document"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Install Extra Modules
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Install more modules. A few modules are proposed according
to the Account Profile you selected. You will be able to
install them based on our requirements."/>
<separator string="Accounting Management" colspan="4"/>
<field name="account_analytic_analysis"/>
<field name="account_analytic_plans"/>
<field name="account_payment"/>
<separator string="Resources Management" colspan="4"/>
<field name="account_budget"/>
<field name="account_asset"/>
<separator string="Services Management" colspan="4"/>
<field name="hr_timesheet_invoice"/>
<field name="board_document"/>
</group>
</data>
</field>
</record>
@ -31,16 +35,15 @@
<field name="name">Accounting Profile : Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">profile.accounting.config.install_modules_wizard</field>
<field name="view_id" ref="view_confirm_install_module_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo"
id="profile_accounting.config_install_wizard">
<field name="name">Accounting Profile : Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the Account Profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
<record model="ir.actions.todo"
id="profile_accounting.config_install_wizard">
<field name="action_id" ref="action_config_install_module"/>
</record>
</data>
</openerp>

View File

@ -25,6 +25,8 @@ import pooler
class profile_association_config_install_modules_wizard(osv.osv_memory):
_name='profile.association.config.install_modules_wizard'
_inherit = 'res.config'
_columns = {
'hr_expense':fields.boolean('Expenses Tracking', help="Tracks the personal expenses process, from the employee expense encoding, to the reimbursement of the employee up to the reinvoicing to the final customer."),
'project':fields.boolean('Project Management'),
@ -36,30 +38,15 @@ class profile_association_config_install_modules_wizard(osv.osv_memory):
'wiki': fields.boolean('Wiki',
help="An integrated wiki content management system. This is really usefull to manage FAQ, quality manuals, etc.")
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
def execute(self, cr, uid, ids, context=None):
result = self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
if r != 'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.button_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
profile_association_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,24 +5,27 @@
<field name="name">Association Profile : Install extra modules</field>
<field name="model">profile.association.config.install_modules_wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Project Management" colspan="4"/>
<field name="project"/>
<field name="project_gtd"/>
<field name="wiki"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_expense"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
<separator string="" colspan="4"/>
<field name="board_document"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Install Extra Modules
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Install more modules. A few modules are proposed according
to the Account Profile you selected. You will be able to
install them based on our requirements."/>
<separator string="Project Management" colspan="4"/>
<field name="project"/>
<field name="project_gtd"/>
<field name="wiki"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_expense"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
</group>
</data>
</field>
</record>
@ -30,6 +33,7 @@
<field name="name">Association Profile : Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">profile.association.config.install_modules_wizard</field>
<field name="view_id" ref="view_confirm_install_module_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
@ -37,8 +41,6 @@
<record model="ir.actions.todo"
id="config_install_module">
<field name="name">Association Profile : Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the association profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
</record>
</data>

View File

@ -25,6 +25,8 @@ import pooler
class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
_name='profile.manufacturing.config.install_modules_wizard'
_inherit = 'res.config'
_columns = {
'mrp_jit':fields.boolean('Just in Time Scheduling',
help="The JIT module allows you to not run the scheduler "\
@ -76,31 +78,16 @@ class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
help="Allows to manage product repairs. Handle the guarantee limit date and the invoicing of products and services."),
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
def execute(self, cr, uid, ids, context=None):
result = self.read(cr,uid,ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
if r != 'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.button_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname,update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
profile_manufacturing_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,46 +5,50 @@
<field name="name">Manufacturing Profile: Install Extra Modules</field>
<field name="model">profile.manufacturing.config.install_modules_wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Manufacturing Profile: Install Extra Modules">
<separator string="Stock &amp; Manufacturing" colspan="4"/>
<field name="stock_location"/>
<field name="mrp_jit"/>
<field name="mrp_operation"/>
<field name="mrp_subproduct"/>
<field name="mrp_repair"/>
<separator string="Sales Management" colspan="4"/>
<field name="point_of_sale"/>
<field name="sale_journal"/>
<field name="sale_margin"/>
<separator string="Relationship Management" colspan="4"/>
<field name="sale_crm"/>
<field name="board_document"/>
<field name="warning"/>
<field name="portal"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Manufacturing Profile: Install Extra Modules
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Here are a few modules which might be useful along with
the rest of the Manufacturing profile. You can also install
them the normal way later on, but if you think you'll need
them to fit your requirements, you can select them now and
they'll be installed immediately."/>
<separator string="Stock &amp; Manufacturing" colspan="4"/>
<field name="stock_location"/>
<field name="mrp_jit"/>
<field name="mrp_operation"/>
<field name="mrp_subproduct"/>
<field name="mrp_repair"/>
<separator string="Sales Management" colspan="4"/>
<field name="point_of_sale"/>
<field name="sale_journal"/>
<field name="sale_margin"/>
<separator string="Relationship Management" colspan="4"/>
<field name="sale_crm"/>
<field name="board_document"/>
<field name="warning"/>
<field name="portal"/>
</group>
<xpath expr='//button[@name="action_skip"]' position='replace'/>
</data>
</field>
</record>
<record id="action_config_install_module" model="ir.actions.act_window">
<field name="name">Manufacturing Profile: Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">profile.manufacturing.config.install_modules_wizard</field>
<field name="view_id" ref="view_confirm_install_module_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.actions.todo"
id="config_install_module">
<field name="name">Manufacturing Profile: Install Extra modules</field>
<field name="note">Install more modules. A few modules are proposed according to the manufacturing profile you selected. You will be able to install them based on our requirements.</field>
<field name="action_id" ref="action_config_install_module"/>
</record>
</data>

View File

@ -24,6 +24,7 @@ import pooler
class profile_service_config_install_modules_wizard(osv.osv_memory):
_name='profile.service.config.install_modules_wizard'
_inherit = 'res.config'
_rec_name = 'crm_configuration'
_columns = {
'crm_configuration':fields.boolean('CRM & Calendars', help="This installs the customer relationship features like: leads and opportunities tracking, shared calendar, jobs tracking, bug tracker, and so on."),
@ -46,31 +47,16 @@ class profile_service_config_install_modules_wizard(osv.osv_memory):
help="An integrated wiki content management system. This is really "\
"useful to manage FAQ, quality manuals, etc.")
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_install(self, cr, uid, ids, context=None):
result=self.read(cr,uid,ids)
def execute(self, cr, uid, ids, context=None):
result = self.read(cr, uid, ids)
mod_obj = self.pool.get('ir.module.module')
for res in result:
for r in res:
if r<>'id' and res[r]:
if r != 'id' and res[r]:
ids = mod_obj.search(cr, uid, [('name', '=', r)])
mod_obj.button_install(cr,uid,ids,context=context)
mod_obj.button_install(cr, uid, ids, context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
profile_service_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -5,32 +5,37 @@
<field name="name">Service Profile : Install extra modules</field>
<field name="model">profile.service.config.install_modules_wizard</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Install Extra Module">
<separator string="Services Management" colspan="4"/>
<field name="project_timesheet"/>
<field name="hr_timesheet_invoice"/>
<field name="project_gtd"/>
<field name="scrum"/>
<field name="project_mrp"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_holidays"/>
<field name="hr_expense"/>
<field name="account_budget_crossover"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
<field name="base_contact"/>
<field name="board_document"/>
<separator string="Portal Management" colspan="4"/>
<field name="portal"/>
<field name="wiki"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="2">
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
<button name="action_install" string="Install" icon='gtk-ok' type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Install Extra Modules
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
A few modules are proposed according to the
'service profile' you selected. You will be able to
install them or more modules later through the
Administration menu."/>
<separator string="Services Management" colspan="4"/>
<field name="project_timesheet"/>
<field name="hr_timesheet_invoice"/>
<field name="project_gtd"/>
<field name="scrum"/>
<field name="project_mrp"/>
<separator string="Resources Management" colspan="4"/>
<field name="hr_holidays"/>
<field name="hr_expense"/>
<field name="account_budget_crossover"/>
<separator string="Relationship Management" colspan="4"/>
<field name="crm_configuration"/>
<field name="base_contact"/>
<field name="board_document"/>
<separator string="Portal Management" colspan="4"/>
<field name="portal"/>
<field name="wiki"/>
</group>
</data>
</field>
</record>
@ -38,6 +43,7 @@
<field name="name">Service Profile : Install Extra Modules</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">profile.service.config.install_modules_wizard</field>
<field name="view_id" ref="view_confirm_install_module_form"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
@ -45,8 +51,6 @@
<record model="ir.actions.todo"
id="config_install_module">
<field name="name">Service Profile : Install Extra modules</field>
<field name="note">A few modules are proposed according to the 'service profile' you selected. You will be able to install them or more modules later through the Administration menu.</field>
<field name="action_id" ref="action_config_install_module"/>
</record>

View File

@ -1062,6 +1062,8 @@ sale_order_line()
class sale_config_picking_policy(osv.osv_memory):
_name = 'sale.config.picking_policy'
_inherit = 'res.config'
_columns = {
'name': fields.char('Name', size=64),
'picking_policy': fields.selection([
@ -1087,7 +1089,7 @@ class sale_config_picking_policy(osv.osv_memory):
'step': lambda *a: 'one'
}
def set_default(self, cr, uid, ids, context=None):
def execute(self, cr, uid, ids, context=None):
for o in self.browse(cr, uid, ids, context=context):
ir_values_obj = self.pool.get('ir.values')
ir_values_obj.set(cr, uid, 'default', False, 'picking_policy', ['sale.order'], o.picking_policy)
@ -1104,23 +1106,5 @@ class sale_config_picking_policy(osv.osv_memory):
location_id = md._get_id(cr, uid, 'stock', 'stock_location_output')
location_id = md.browse(cr, uid, location_id, context).res_id
self.pool.get('stock.location').write(cr, uid, [location_id], {'chained_auto_packing': 'transparent'})
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
}
def action_cancel(self, cr, uid, ids, context=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.actions.configuration.wizard',
'type': 'ir.actions.act_window',
'target': 'new',
}
sale_config_picking_policy()

View File

@ -448,21 +448,27 @@
<field name="name">Configure Picking Policy for Sale Order </field>
<field name="model">sale.config.picking_policy</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="arch" type="xml">
<form string="Sales Configuration">
<separator colspan="4" string="Configure Sale Order Logistic"/>
<newline/>
<field name="picking_policy"/>
<newline/>
<field name="order_policy"/>
<newline/>
<field name="step"/>
<separator string="" colspan="4"/>
<group col="4" colspan="4">
<button icon="gtk-cancel" name="action_cancel" type="object" special="cancel" string="Cancel"/>
<button icon="gtk-ok" name="set_default" string="Set Default" type="object"/>
</group>
</form>
<data>
<form position="attributes"><attribute name="string">
Sales Configuration
</attribute></form>
<group string="res_config_contents" position="replace">
<label colspan="4" align="0.0" string="
Set the policies selected by default when creating a new
sale order."/>
<separator colspan="4"
string="Configure Sale Order Logistic"/>
<newline/>
<field name="picking_policy"/>
<newline/>
<field name="order_policy"/>
<newline/>
<field name="step"/>
</group>
<xpath expr='//button[@name="action_skip"]' position='replace'/>
</data>
</field>
</record>
@ -470,6 +476,7 @@
<field name="name">Configure Picking Policy for Sale Order</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.config.picking_policy</field>
<field name="view_id" ref="view_config_picking_policy"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
@ -477,8 +484,6 @@
<!-- register configuration wizard -->
<record id="config_wizard_step_sale_picking_policy" model="ir.actions.todo">
<field name="name">Select the default picking policy for Sale Order</field>
<field name="note">This Configuration step use to set default picking policy when make sale order</field>
<field name="action_id" ref="action_config_picking_policy"/>
</record>