[MRG] merge with lp:~openerp-dev/openobject-addons/trunk-v62_config_sale-uco
bzr revid: tpa@tinyerp.com-20120301055045-x0tx8boe1clko272
This commit is contained in:
@@ -50,7 +50,7 @@ class account_configuration(osv.osv_memory):
|
||||
res.update({'tax_value': 15.0})
|
||||
tax_id = self._check_default_tax(cr, uid, context)
|
||||
if tax_id:
|
||||
res.update({'tax_value': tax_id and tax_id[0]})
|
||||
res.update({'tax_value': tax_id and tax_id[0]})
|
||||
return res
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
@@ -66,6 +66,7 @@ class account_configuration(osv.osv_memory):
|
||||
chart_template_obj = self.pool.get('account.chart.template')
|
||||
tax_template_obj = self.pool.get('account.tax.template')
|
||||
chart_template_ids = chart_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
|
||||
taxes = []
|
||||
if chart_template_ids:
|
||||
taxes = tax_template_obj.search(cr, uid, [('chart_template_id', '=', chart_template_ids[0])], context=context)
|
||||
result = {}
|
||||
|
||||
@@ -119,10 +119,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<field name="account_analytic_analysis" position="after">
|
||||
<newline/>
|
||||
<field name="analytic_user_function"/>
|
||||
<newline/>
|
||||
<field name="analytic_journal_billing_rate"/>
|
||||
<newline/>
|
||||
<field name="analytic_user_function" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
|
||||
<field name="analytic_journal_billing_rate" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<field name="is_ssl" on_change="onchange_server_type(type, is_ssl)"/>
|
||||
<newline/>
|
||||
<field name="user" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
|
||||
<field name="password" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
|
||||
<field name="password" password="True" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="plugin_outlook" position="after">
|
||||
<button name="%(action_outlook_installer)d" type="action" string="Configure Outlook Plug-In" icon="gtk-execute" colspan="2"/>
|
||||
<button name="%(action_outlook_installer)d" type="action" string="Configure" icon="gtk-execute"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="plugin_thunderbird" position="after">
|
||||
<button name="%(action_thunderbird_installer)d" type="action" string="Configure Thunderbird Plug-In" icon="gtk-execute" colspan="2"/>
|
||||
<button name="%(action_thunderbird_installer)d" type="action" string="Configure" icon="gtk-execute"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -102,11 +102,26 @@ class sale_configuration(osv.osv_memory):
|
||||
('state','in',['to install', 'installed', 'to upgrade'])],
|
||||
context=context)
|
||||
installed_modules = dict([(mod.name,True) for mod in module_obj.browse(cr, uid, module_ids, context=context)])
|
||||
if installed_modules.get('project_mrp') and installed_modules.get('project_timesheet'):
|
||||
installed_modules['task_work'] = True
|
||||
if installed_modules.get('account_analytic_analysis'):
|
||||
installed_modules['timesheet'] = True
|
||||
return installed_modules
|
||||
|
||||
def get_default_sale_configs(self, cr, uid, ids, context=None):
|
||||
ir_values_obj = self.pool.get('ir.values')
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
menu_obj = self.pool.get('ir.ui.menu')
|
||||
result = {}
|
||||
invoicing_groups_id = [gid.id for gid in data_obj.get_object(cr, uid, 'sale', 'menu_invoicing_sales_order_lines').groups_id]
|
||||
picking_groups_id = [gid.id for gid in data_obj.get_object(cr, uid, 'sale', 'menu_action_picking_list_to_invoice').groups_id]
|
||||
group_id = data_obj.get_object(cr, uid, 'base', 'group_sale_salesman').id
|
||||
for menu in ir_values_obj.get(cr, uid, 'default', False, ['ir.ui.menu']):
|
||||
if menu[1] == 'groups_id' and group_id in menu[2][0]:
|
||||
if group_id in invoicing_groups_id:
|
||||
result['sale_orders'] = True
|
||||
if group_id in picking_groups_id:
|
||||
result['deli_orders'] = True
|
||||
for res in ir_values_obj.get(cr, uid, 'default', False, ['sale.order']):
|
||||
result[res[1]] = res[2]
|
||||
return result
|
||||
@@ -151,11 +166,11 @@ class sale_configuration(osv.osv_memory):
|
||||
def set_modules(self, cr, uid, ids, vals, context=None):
|
||||
module_obj = self.pool.get('ir.module.module')
|
||||
MODULE_LIST = vals.get('modules')
|
||||
if vals.get('task_work'):
|
||||
vals.update({'project_timesheet': True,'project_mrp': True})
|
||||
if vals.get('timesheet'):
|
||||
vals.update({'account_analytic_analysis': True})
|
||||
for k, v in vals.items():
|
||||
if k == 'task_work':
|
||||
MODULE_LIST += ['project_timesheet','project_mrp']
|
||||
if k == 'timesheet':
|
||||
MODULE_LIST += ['account_analytic_analysis']
|
||||
if k in MODULE_LIST:
|
||||
installed = self.get_default_installed_modules(cr, uid, [k], context)
|
||||
if v == True and not installed.get(k):
|
||||
|
||||
Reference in New Issue
Block a user