[IMP]:usabiliy improvemetns
bzr revid: nch@tinyerp.com-20100505045349-ssq1racv9tvzc22h
This commit is contained in:
parent
6f53850e7d
commit
7987651523
|
@ -2390,10 +2390,14 @@ class account_bank_accounts_wizard(osv.osv_memory):
|
|||
_name='account.bank.accounts.wizard'
|
||||
|
||||
_columns = {
|
||||
'acc_no':fields.many2one('res.partner.bank','Account No.',required=True),
|
||||
'acc_name':fields.char('Account Name.', size=64, required=True),
|
||||
'bank_account_id':fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True),
|
||||
'currency_id':fields.many2one('res.currency', 'Currency'),
|
||||
'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
|
||||
}
|
||||
|
||||
account_bank_accounts_wizard()
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</separator>
|
||||
<xpath expr="//label[@string='description']"
|
||||
position="attributes">
|
||||
<attribute name="string">You can enhance OpenERP's basic accounting support with a few additional OpenERP applications</attribute>
|
||||
<attribute name="string">You can enhance OpenERP's basic accounting support with a few additional OpenERP applications. Select one of the country specific chart of account or select 'configurable chart of account' to configure your own chart of account.</attribute>
|
||||
<attribute name="width">150</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//button[@string='Install Modules']" position="attributes">
|
||||
|
@ -36,11 +36,24 @@
|
|||
<field name="account_followup"/>
|
||||
<field name="account_asset"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('charts','=',False)]}">
|
||||
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
|
||||
<field name="sale_tax" colspan="2"/>
|
||||
<field name="purchase_tax" colspan="2"/>
|
||||
</group>
|
||||
<group colspan="4" attrs="{'invisible':[('charts','!=','configurable')]}">
|
||||
<separator col="4" colspan="4" string="Bank and Cost Account"/>
|
||||
<field name="account_name" colspan="2"/>
|
||||
<field name="account_type" colspan="2"/>
|
||||
<field name="account_currency" colspan="2" widget="selection"/>
|
||||
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
|
||||
<form string="Bank Information">
|
||||
<field name="acc_name"/>
|
||||
<field name="account_type"/>
|
||||
<field name="currency_id"/>
|
||||
</form>
|
||||
<tree editable="bottom" string="Bank Information">
|
||||
<field name="acc_name"/>
|
||||
<field name="account_type"/>
|
||||
<field name="currency_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<separator col="4" colspan="4" string="Configure Fiscal Year"/>
|
||||
|
@ -66,6 +79,20 @@
|
|||
<record id="account_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_account_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="restart">onskip</field>
|
||||
</record>
|
||||
|
||||
<record id="account_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">account_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_account_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -1719,11 +1719,13 @@
|
|||
<field colspan="4" mode="tree" name="bank_accounts_id"
|
||||
nolabel="1" widget="one2many_list">
|
||||
<form string="Bank Information">
|
||||
<field name="acc_no"/>
|
||||
<field name="acc_name"/>
|
||||
<field name="account_type"/>
|
||||
<field name="currency_id"/>
|
||||
</form>
|
||||
<tree editable="bottom" string="Bank Information">
|
||||
<field name="acc_no"/>
|
||||
<field name="acc_name"/>
|
||||
<field name="account_type"/>
|
||||
<field name="currency_id"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
@ -37,9 +37,20 @@ class account_installer(osv.osv_memory):
|
|||
sorted(((m.name, m.shortdesc)
|
||||
for m in modules.browse(cr, uid, ids)),
|
||||
key=itemgetter(1)))
|
||||
charts.insert(0,('',''))
|
||||
charts.insert(0,('configurable','Configurable Chart of Account'))
|
||||
return charts
|
||||
|
||||
# def default_get(self, cr, uid, fields_list=None, context=None):
|
||||
# ''' set default accounts'''
|
||||
# defaults = super(account_installer, self)\
|
||||
# .default_get(cr, uid, fields_list=fields_list, context=context)
|
||||
# account = self.pool.get('account.bank.accounts.wizard')
|
||||
# ids = []
|
||||
# for acc in ('Current','Deposit'):
|
||||
# ids.append(account.create(cr, uid, {'acc_name':acc,'account_type':'cash','bank_account_id':self}))
|
||||
# defaults.update({'bank_accounts_id':[(6,0,ids)]})
|
||||
# return defaults
|
||||
|
||||
_columns = {
|
||||
# Accounting
|
||||
'charts':fields.selection(_get_charts, 'Chart of Accounts',
|
||||
|
@ -64,15 +75,16 @@ class account_installer(osv.osv_memory):
|
|||
'date_stop': fields.date('End Date', required=True),
|
||||
'period':fields.selection([('month','Monthly'), ('3months','3 Monthly')],
|
||||
'Periods', required=True),
|
||||
'account_name':fields.char('Name', size=128),
|
||||
'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32),
|
||||
'account_currency':fields.many2one('res.currency', 'Currency')
|
||||
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Bank Accounts',required=True),
|
||||
'sale_tax':fields.float('Sale Tax(%)'),
|
||||
'purchase_tax':fields.float('Purchase Tax(%)')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': lambda *a: time.strftime('%Y-01-01'),
|
||||
'date_stop': lambda *a: time.strftime('%Y-12-31'),
|
||||
'period':lambda *a:'month',
|
||||
'account_currency': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
|
||||
'sale_tax':lambda *a:0.0,
|
||||
'purchase_tax':lambda *a:0.0,
|
||||
}
|
||||
|
||||
def on_change_start_date(self, cr, uid, id, start_date):
|
||||
|
@ -84,9 +96,43 @@ class account_installer(osv.osv_memory):
|
|||
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
super(account_installer, self).execute(cr, uid, ids, context=context)
|
||||
record = self.browse(cr, uid, ids, context=context)[0]
|
||||
for res in self.read(cr,uid,ids):
|
||||
if record.charts == 'configurable':
|
||||
obj_acc = self.pool.get('account.account')
|
||||
obj_tax = self.pool.get('account.tax')
|
||||
user_type = self.pool.get('account.account.type')
|
||||
obj_product = self.pool.get('product.product')
|
||||
ir_values = self.pool.get('ir.values')
|
||||
u_type_id = user_type.search(cr, uid,[('name','ilike','view')])[0]
|
||||
company = self.pool.get('res.users').browse(cr, uid, uid, context).company_id
|
||||
vals = {'name': company.name or '',
|
||||
'currency_id': company.currency_id.id or False,
|
||||
'code': 0 or '',
|
||||
'type': 'view',
|
||||
'user_type': u_type_id,
|
||||
'company_id': company.id }
|
||||
main_account = obj_acc.create(cr, uid, vals)
|
||||
for val in record.bank_accounts_id:
|
||||
vals = {'name': val.acc_name or '',
|
||||
'currency_id': val.currency_id.id or False,
|
||||
'code': val.acc_name or '',
|
||||
'type': 'view',
|
||||
'user_type': u_type_id,
|
||||
'parent_id':main_account,
|
||||
'company_id': company.id }
|
||||
obj_acc.create(cr, uid, vals)
|
||||
|
||||
sales_tax = obj_tax.create(cr, uid,{'name':'sale Tax','amount':res.get('sale_tax',0.0)})
|
||||
purchase_tax = obj_tax.create(cr, uid,{'name':'purchase Tax','amount':res.get('purchase_tax',0.0)})
|
||||
product_ids = obj_product.search(cr,uid, [])
|
||||
for product in obj_product.browse(cr, uid, product_ids):
|
||||
obj_product.write(cr, uid, product.id, {'taxes_id':[(6,0,[sales_tax])],'supplier_taxes_id':[(6,0,[purchase_tax])]})
|
||||
for name, value in [('taxes_id',sales_tax),('supplier_taxes_id',purchase_tax)]:
|
||||
ir_values.set(cr, uid, key='default', key2=False, name=name, models =[('product.product',False)], value=[value])
|
||||
|
||||
if 'date_start' in res and 'date_stop' in res:
|
||||
name = res['date_start'][:4]
|
||||
name = code = res['date_start'][:4]
|
||||
if int(name) != int(res['date_stop'][:4]):
|
||||
name = res['date_start'][:4] +'-'+ res['date_stop'][:4]
|
||||
code = res['date_start'][2:4] +'-'+ res['date_stop'][2:4]
|
||||
|
@ -114,3 +160,18 @@ class account_installer(osv.osv_memory):
|
|||
|
||||
|
||||
account_installer()
|
||||
|
||||
class account_bank_accounts_wizard(osv.osv_memory):
|
||||
_name='account.bank.accounts.wizard'
|
||||
|
||||
_columns = {
|
||||
'acc_name':fields.char('Account Name.', size=64, required=True),
|
||||
'bank_account_id':fields.many2one('wizard.multi.charts.accounts', 'Bank Account', required=True),
|
||||
'currency_id':fields.many2one('res.currency', 'Currency'),
|
||||
'account_type':fields.selection([('cash','Cash'),('check','Check'),('bank','Bank')], 'Type', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
'currency_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.currency_id.id,
|
||||
}
|
||||
|
||||
account_bank_accounts_wizard()
|
||||
|
|
|
@ -48,5 +48,16 @@
|
|||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="association_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">association_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_config_install_module)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
import installer
|
||||
import todo
|
||||
import gtk_contact_form
|
||||
import wizard
|
||||
|
||||
from osv import fields, osv
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
'init_xml': ['base_setup_data.xml'],
|
||||
'update_xml': ['security/ir.model.access.csv',
|
||||
'base_setup_installer.xml',
|
||||
'base_setup_todo.xml',],
|
||||
'base_setup_todo.xml','gtk_contact_form.xml'],
|
||||
'demo_xml': ['base_setup_demo.xml'],
|
||||
'installable': True,
|
||||
'active': True,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<xpath expr="//label[@string='description']"
|
||||
position="attributes">
|
||||
<attribute name="string"
|
||||
>Now that OpenERP is installed, we have selected applications commonly useful to users which you can install directly, as well as sets of applications for more specific types or groups of businesses (the vertical modules).
|
||||
>Now that OpenERP is installed, We have selected applications commonly useful to users which you can install directly, as well as sets of applications for more specific types or groups of businesses (the vertical modules).
|
||||
|
||||
If you don't think you need any of these right now, you can easily install them later on.</attribute>
|
||||
</xpath>
|
||||
|
@ -56,5 +56,16 @@ If you don't think you need any of these right now, you can easily install them
|
|||
<field name="action_id" ref="action_base_setup_installer"/>
|
||||
<field name="sequence">2</field>
|
||||
</record>
|
||||
<record id="base_setup_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">base_setup_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_base_setup_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -52,5 +52,16 @@
|
|||
<field name="action_id" ref="action_hr_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="hr_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">hr_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_hr_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -53,5 +53,17 @@
|
|||
<field name="sequence">3</field>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_extended')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="knowledge_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">knowledge_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_knowledge_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -48,5 +48,17 @@
|
|||
<field name="sequence">3</field>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_extended')])]"/>
|
||||
</record>
|
||||
|
||||
<record id="mrp_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">mrp_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_mrp_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -48,5 +48,16 @@
|
|||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="accounting_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">accounting_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_config_install_module)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -55,5 +55,16 @@
|
|||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="manufacturing_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">manufacturing_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_config_install_module)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -47,5 +47,16 @@
|
|||
<field name="action_id" ref="action_misc_tools_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="misc_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">misc_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_misc_tools_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -53,5 +53,16 @@
|
|||
<field name="action_id" ref="action_project_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="project_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">project_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_project_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -46,5 +46,16 @@
|
|||
<field name="sequence">3</field>
|
||||
<field name="groups_id" eval="[(6,0,[ref('base.group_extended')])]"/>
|
||||
</record>
|
||||
<record id="purchase_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">purchase_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_purchase_install_module)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -46,5 +46,16 @@
|
|||
<field name="action_id" ref="action_report_designer_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="report_designer_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">report_designer_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_report_designer_installer)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -60,5 +60,16 @@
|
|||
<field name="action_id" ref="action_config_install_module"/>
|
||||
<field name="sequence">3</field>
|
||||
</record>
|
||||
<record id="service_ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
<field name="name">service_installer_action_replace</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="base.ir_actions_todo_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//button[@string='Launch']" position="replace">
|
||||
<button name="%(action_config_install_module)d" states="open,skip" string="Launch" type="action" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue