diff --git a/addons/account/res_config.py b/addons/account/res_config.py
index 92692084b75..484bd7f520a 100644
--- a/addons/account/res_config.py
+++ b/addons/account/res_config.py
@@ -30,17 +30,16 @@ class account_configuration(osv.osv_memory):
('no_tax', 'No Tax'),
('global_on_order', 'Global On Order'),
('on_order_line', 'On Order Lines'),
- ], 'Taxes', required=True,
- help = """
- This allows you to set tax policy to sale order.
- if you want to set global tax on sale order then select Global On Order it will add 'Global On Order' group to employees.
- if you want to set tax On Order Lines then select On Order Lines it will add 'On Order Lines' group to employees.
+ ], 'Taxes', required=True,
+ help="""
+ If you want to apply global tax on sale order then select 'Global On Order' it will add 'Global On Order' group to employees.
+ If you want to apply different taxes for sale order lines then select 'On Order Lines' it will add 'On Order Lines' group to employees.
"""),
'tax_value': fields.float('Value'),
}
_defaults = {
- 'tax_policy': 'global_on_order',
+ 'tax_policy': 'global_on_order',
}
def get_default_tax_policy(self, cr, uid, ids, context=None):
@@ -52,14 +51,14 @@ class account_configuration(osv.osv_memory):
else:
applied_groups.update({'tax_policy': 'no_tax'})
return applied_groups
-
+
def _check_default_tax(self, cr, uid, context=None):
ir_values_obj = self.pool.get('ir.values')
for tax in ir_values_obj.get(cr, uid, 'default', False, ['product.product']):
if tax[1] == 'taxes_id':
return tax[2]
return False
-
+
def default_get(self, cr, uid, fields_list, context=None):
ir_values_obj = self.pool.get('ir.values')
res = super(account_configuration, self).default_get(cr, uid, fields_list, context=context)
@@ -75,7 +74,7 @@ class account_configuration(osv.osv_memory):
if self._check_default_tax(cr, uid, context) and res['fields'].get('tax_value'):
res['fields']['tax_value'] = {'domain': [], 'views': {}, 'context': {}, 'selectable': True, 'type': 'many2one', 'relation': 'account.tax', 'string': 'Value'}
return res
-
+
def set_tax_policy(self, cr, uid, ids, vals, context=None):
data_obj = self.pool.get('ir.model.data')
users_obj = self.pool.get('res.users')
@@ -103,30 +102,10 @@ class account_configuration(osv.osv_memory):
users_obj.write(cr, uid, [uid], {'groups_id': [(3,remove_group_id)]})
ir_values_obj.set(cr, uid, 'default', False, 'groups_id', ['res.users'], [(3,remove_group_id)])
else:
- groups = [order_group_id, remove_group_id]
+ groups = [order_group_id, order_line_group_id]
for group_id in groups:
groups_obj.write(cr, uid, [user_group_id], {'implied_ids': [(3,group_id)]})
users_obj.write(cr, uid, [uid], {'groups_id': [(3,group_id)]})
ir_values_obj.set(cr, uid, 'default', False, 'groups_id', ['res.users'], [(3,group_id)])
- def set_tax_value(self, cr, uid, ids, vals, context=None):
- chart_account_obj = self.pool.get('wizard.multi.charts.accounts')
- acc_installer_obj = self.pool.get('account.installer')
- chart_template_obj = self.pool.get('account.chart.template')
- tax_obj = self.pool.get('account.tax')
- chart_template_ids = chart_template_obj.search(cr, uid, [('visible', '=', True)], context=context)
- taxes = []
- if chart_template_ids:
- name = _('Tax %.2f%%') % vals.get('tax_value')
- taxes = tax_obj.search(cr, uid, [('name', '=', name)], context=context)
- check_default_taxes = self._check_default_tax(cr, uid, context)
- if not check_default_taxes and not taxes:
- installer_id = acc_installer_obj.create(cr, uid, {}, context=context)
- acc_installer_obj.execute(cr, uid, [installer_id], context=context)
- if chart_template_ids:
- code_digits = chart_account_obj.onchange_chart_template_id(cr, uid, [], chart_template_ids[0], context=context)['value']['code_digits']
- object_id = chart_account_obj.create(cr, uid, {'code_digits': code_digits}, context=context)
- chart_account_obj.execute(cr, uid, [object_id], context=context)
- return check_default_taxes
-
account_configuration()
\ No newline at end of file
diff --git a/addons/account_analytic_analysis/account_analytic_analysis_view.xml b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
index 5558d5f3323..347c6c0c0c9 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis_view.xml
+++ b/addons/account_analytic_analysis/account_analytic_analysis_view.xml
@@ -117,11 +117,13 @@
form
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/addons/crm/res_config.py b/addons/crm/res_config.py
index 7657982c93d..a86c2aabf4f 100644
--- a/addons/crm/res_config.py
+++ b/addons/crm/res_config.py
@@ -25,16 +25,12 @@ class crm_configuration(osv.osv_memory):
_inherit = 'res.config'
_columns = {
- 'module_crm_caldav' : fields.boolean("Caldav synchronization",
- help="""
- This allows you Caldav features in Meeting, Share meeting with other calendar clients like sunbird.
- It installs crm_caldav module.
- """),
- 'module_fetchmail_crm': fields.boolean("Lead/Opportunity mail gateway",
- help = """
- this allows you to configure your incoming mail server.
- It installs fetchmail_crm module.
- """),
+ 'module_crm_caldav' : fields.boolean("Use caldav to synchronize Meetings",
+ help="""This allows you Caldav features in Meeting, Share meeting with other calendar clients like sunbird.
+ It installs crm_caldav module."""),
+ 'module_fetchmail_crm': fields.boolean("Lead/Opportunity mail gateway", help="""
+ This allows you to configure your incoming mail server,
+ It installs fetchmail_crm module."""),
'server' : fields.char('Server Name', size=256),
'port' : fields.integer('Port'),
'type': fields.selection([
@@ -99,7 +95,7 @@ class crm_configuration(osv.osv_memory):
ir_values_obj = self.pool.get('ir.values')
result = {}
installed_modules = self.get_default_installed_modules(cr, uid, ids, context=context)
- if 'fetchmail_crm' in installed_modules.keys():
+ if 'module_fetchmail_crm' in installed_modules.keys():
for val in ir_values_obj.get(cr, uid, 'default', False, ['fetchmail.server']):
result.update({val[1]: val[2]})
return result
@@ -120,11 +116,11 @@ class crm_configuration(osv.osv_memory):
model_obj = self.pool.get('ir.model')
fetchmail_obj = self.pool.get('fetchmail.server')
ir_values_obj = self.pool.get('ir.values')
- if vals.get('fetchmail_crm'):
- object_id = model_obj.search(cr, uid, [('model','=','crm.lead')])[0]
+ object_id = model_obj.search(cr, uid, [('model','=','crm.lead')])
+ if vals.get('module_fetchmail_crm') and object_id:
fetchmail_vals = {
'name': 'Incoming Leads',
- 'object_id': object_id,
+ 'object_id': object_id[0],
'server': vals.get('server'),
'port': vals.get('port'),
'is_ssl': vals.get('is_ssl'),
@@ -133,7 +129,7 @@ class crm_configuration(osv.osv_memory):
'password': vals.get('password')
}
server_ids = fetchmail_obj.search(cr, uid, [])
- if not self.get_default_installed_modules(cr, uid, ['fetchmail_crm'], context) or not server_ids:
+ if not self.get_default_installed_modules(cr, uid, ids, context) or not server_ids:
tt = fetchmail_obj.create(cr, uid, fetchmail_vals, context=context)
else:
fetchmail_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads')], context=context)
diff --git a/addons/crm/res_config_view.xml b/addons/crm/res_config_view.xml
index 8fd35eb0ab5..46b3447c673 100644
--- a/addons/crm/res_config_view.xml
+++ b/addons/crm/res_config_view.xml
@@ -5,34 +5,34 @@
Sales Applicationres.configform
-
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -59,8 +59,11 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/addons/plugin_outlook/plugin_outlook.xml b/addons/plugin_outlook/plugin_outlook.xml
index 27fd8d6d11f..33a94dc2b42 100644
--- a/addons/plugin_outlook/plugin_outlook.xml
+++ b/addons/plugin_outlook/plugin_outlook.xml
@@ -52,9 +52,9 @@
Sales Applicationres.configform
-
+
-
+
diff --git a/addons/plugin_thunderbird/plugin_thunderbird.xml b/addons/plugin_thunderbird/plugin_thunderbird.xml
index 92da206d4b3..619f26aa9d2 100644
--- a/addons/plugin_thunderbird/plugin_thunderbird.xml
+++ b/addons/plugin_thunderbird/plugin_thunderbird.xml
@@ -59,9 +59,9 @@
Sales Applicationres.configform
-
+
-
+
diff --git a/addons/product/res_config.py b/addons/product/res_config.py
index 3c92e97a879..654d31d9d8c 100644
--- a/addons/product/res_config.py
+++ b/addons/product/res_config.py
@@ -25,15 +25,14 @@ class product_groups_configuration(osv.osv_memory):
_inherit = 'res.config'
_columns = {
- 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer ",
- help="""
- Allows to manage different prices based on rules per category of customers. Example: 10% for retailers, promotion of 5 EUR on this product,
- It assigns the "pricelist" group to all employees
- """),
+ 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer",
+ help="""Allows to manage different prices based on rules per category of customers.
+ Example: 10% for retailers, promotion of 5 EUR on this product, etc.
+ It assigns the "Pricelist" group to all employees."""),
'group_sale_uom_per_product':fields.boolean("UOM per product",
help="""
- This allow different unit of measure per product,
- It assigns the "UOM per product" group to all employees
+ Allows you to select and maintain different unit of measures per product.
+ It assigns the "UOM per product" group to all employees.
"""),
}
diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py
index 33cf3207bd8..0e009e94fea 100644
--- a/addons/sale/res_config.py
+++ b/addons/sale/res_config.py
@@ -23,31 +23,23 @@ from osv import fields, osv
import pooler
from tools.translate import _
-MODULE_LIST = [
- 'analytic_user_function', 'analytic_journal_billing_rate', 'import_sugarcrm',
- 'import_google', 'crm_caldav', 'wiki_sale_faq', 'base_contact','sale_layout','warning',
- 'google_map', 'fetchmail_crm', 'plugin_thunderbird', 'plugin_outlook','account_analytic_analysis',
- 'project_timesheet', 'account_analytic_analysis', 'project_mrp', 'delivery',
- 'sale_margin', 'sale_journal'
-]
-
class sale_configuration(osv.osv_memory):
_inherit = 'res.config'
_columns = {
- 'sale_orders': fields.boolean('Based on Sales Orders',),
- 'deli_orders': fields.boolean('Based on Delivery Orders'),
+ 'sale_orders': fields.boolean('Based on Sales Orders',
+ help="To allow your salesman to make invoices for sale order lines using 'Lines to Invoice' menu."),
+ 'deli_orders': fields.boolean('Based on Delivery Orders',
+ help="To allow your salesman to make invoices for Delivery Orders using 'Deliveries to Invoice' menu."),
'task_work': fields.boolean('Based on Tasks\' Work',
- help="""
- This allows to you transfer the entries under tasks defined for Project Management to
+ help="""Lets you transfer the entries under tasks defined for Project Management to
the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways.
- Automatically creates project tasks from procurement lines.
- It installs the project_timesheet and project_mrp module.
- """),
- 'timesheet': fields.boolean('Based on Timesheet',
+ and to automatically creates project tasks from procurement lines.
+ It installs the project_timesheet and project_mrp module"""),
+ 'module_account_analytic_analysis': fields.boolean('Based on Timesheet',
help = """For modifying account analytic view to show important data to project manager of services companies,
- You can also view the report of account analytic summary user-wise as well as month wise
- ,It installs the account_analytic_analysis module."""),
+ You can also view the report of account analytic summary user-wise as well as month wise.
+ It installs the account_analytic_analysis module."""),
'order_policy': fields.selection([
('manual', 'Invoice Based on Sales Orders'),
('picking', 'Invoice Based on Deliveries'),
@@ -59,9 +51,9 @@ class sale_configuration(osv.osv_memory):
It installs the delivery module.
"""),
'time_unit': fields.many2one('product.uom','Working Time Unit'),
- 'picking_policy' : fields.boolean("Deliver all products at once?", help = "You can set picking policy from sale order that will allow you to deliver all products at one."),
- 'group_sale_delivery_address':fields.boolean("Multiple Address",help="This allows you to set different delivery address and picking address.It assigns Multiple Address group to employee."),
- 'group_sale_disc_per_sale_order_line':fields.boolean("Discounts per sale order lines ",help="This allows you to apply discounts per sale order lines. It assigns Discounts per sale order lines group to employee."),
+ 'picking_policy' : fields.boolean("Deliver all products at once?", help = "You can set picking policy on sale order that will allow you to deliver all products at once."),
+ 'group_sale_delivery_address':fields.boolean("Multiple Address",help="This allows you to set different delivery address and picking address,it assigns Multiple Address group to all employees."),
+ 'group_sale_disc_per_sale_order_line':fields.boolean("Discounts per sale order lines ",help="This allows you to apply discounts per sale order lines, it assigns Discounts per sale order lines group to all employees."),
'module_sale_layout':fields.boolean("Notes & subtotals per line",help="Allows to format sale order lines using notes, separators, titles and subtotals. It installs the sale_layout module."),
'module_warning': fields.boolean("Alerts by products or customers",
help="""To trigger warnings in OpenERP objects.
@@ -81,50 +73,16 @@ class sale_configuration(osv.osv_memory):
'module_analytic_journal_billing_rate' : fields.boolean("Billing rates by contracts",
help=""" This allows you to define what is the default invoicing rate for a specific journal on a given account.
It installs analytic_journal_billing_rate module.
- """),
- 'module_account_analytic_analysis': fields.boolean('Contracts',
- help = """
- For modifying account analytic view to show important data to project manager of services companies,
- You can also view the report of account analytic summary user-wise as well as month wise.
- It installs the account_analytic_analysis module."""),
+ """)
}
-
- def get_default_applied_groups(self, cr, uid, ids, context=None):
- applied_groups = {}
- user_obj = self.pool.get('res.users')
- dataobj = self.pool.get('ir.model.data')
-
- groups = []
- user_group_ids = user_obj.browse(cr, uid, uid, context=context).groups_id
-
- for group_id in user_group_ids:
- groups.append(group_id.id)
-
- for id in groups:
- key_id = dataobj.search(cr, uid,[('res_id','=',id),('model','=','res.groups')],context=context)
- key = dataobj.browse(cr, uid, key_id[0], context=context).name
- applied_groups[key] = True
-
- return applied_groups
-
+
def get_default_installed_modules(self, cr, uid, ids, context=None):
- module_obj = self.pool.get('ir.module.module')
- data_obj = self.pool.get('ir.model.data')
- module_ids = module_obj.search(cr, uid,
- [('name','in',MODULE_LIST),
- ('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 = super(sale_configuration, self).get_default_installed_modules(cr, uid, ids, context=context)
+ if installed_modules.get('module_project_mrp') and installed_modules.get('module_project_timesheet'):
installed_modules['task_work'] = True
prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
uom_id = self.pool.get('product.product').browse(cr, uid, prod_id).uom_id.id
defaults.update({'time_unit': uom_id})
- if installed_modules.get('account_analytic_analysis'):
- installed_modules['timesheet'] = True
- prod_id = data_obj.get_object(cr, uid, 'product', 'product_consultant').id
- uom_id = self.pool.get('product.product').browse(cr, uid, prod_id).uom_id.id
- defaults.update({'time_unit': uom_id})
return installed_modules
def get_default_sale_configs(self, cr, uid, ids, context=None):
@@ -145,13 +103,6 @@ class sale_configuration(osv.osv_memory):
result[res[1]] = res[2]
return result
- def get_default_groups(self, cr, uid, ids, context=None):
- ir_values_obj = self.pool.get('ir.values')
- result = {}
- for res in ir_values_obj.get(cr, uid, 'default', False, ['res.users']):
- result[res[1]] = res[2]
- return result
-
def default_get(self, cr, uid, fields_list, context=None):
result = super(sale_configuration, self).default_get(
cr, uid, fields_list, context=context)
@@ -178,27 +129,16 @@ class sale_configuration(osv.osv_memory):
#TODO: TO BE IMPLEMENTED
for method in dir(self):
if method.startswith('set_'):
- vals['modules'] = MODULE_LIST
getattr(self, method)(cr, uid, ids, vals, context)
return True
- def set_modules(self, cr, uid, ids, vals, context=None):
- module_obj = self.pool.get('ir.module.module')
- MODULE_LIST = vals.get('modules')
+ def set_installed_modules(self, cr, uid, ids, vals, context=None):
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 in MODULE_LIST:
- installed = self.get_default_installed_modules(cr, uid, [k], context)
- if v == True and not installed.get(k):
- module_id = module_obj.search(cr, uid, [('name','=',k)])
- module_obj.button_immediate_install(cr, uid, module_id, context)
- elif v == False and installed.get(k):
- module_id = module_obj.search(cr, uid, [('name','=',k)])
- module_obj.button_uninstall(self, cr, uid, module_id, context=None)
- module_obj.button_upgrade(self, cr, uid, module_id, context=None)
+ vals.update({'module_project_timesheet': True, 'module_project_mrp': True})
+ else:
+ vals.update({'module_project_timesheet': False, 'module_project_mrp': False})
+
+ super(sale_configuration, self).set_installed_modules(cr, uid, ids, vals, context=context)
def set_sale_defaults(self, cr, uid, ids, vals, context=None):
ir_values_obj = self.pool.get('ir.values')
@@ -235,30 +175,9 @@ class sale_configuration(osv.osv_memory):
return res
- def set_groups(self, cr, uid, ids, vals, context=None):
- data_obj = self.pool.get('ir.model.data')
- users_obj = self.pool.get('res.users')
- groups_obj = self.pool.get('res.groups')
- ir_values_obj = self.pool.get('ir.values')
- dummy,user_group_id = data_obj.get_object_reference(cr, uid, 'base', 'group_user')
- for group in vals.keys():
- if group.startswith('group_'):
- dummy,group_id = data_obj.get_object_reference(cr, uid, 'base', group)
- if vals[group]:
- groups_obj.write(cr, uid, [user_group_id], {'implied_ids': [(4,group_id)]})
- users_obj.write(cr, uid, [uid], {'groups_id': [(4,group_id)]})
- ir_values_obj.set(cr, uid, 'default', False, 'groups_id', ['res.users'], [(4,group_id)])
- else:
- groups_obj.write(cr, uid, [user_group_id], {'implied_ids': [(3,group_id)]})
- users_obj.write(cr, uid, [uid], {'groups_id': [(3,group_id)]})
- ir_values_obj.set(cr, uid, 'default', False, 'groups_id', ['res.users'], [(3,group_id)])
-
- def onchange_tax_policy(self, cr, uid, ids, tax_policy, tax_value, context=None):
- res = {'value': {}}
- if isinstance(tax_value, (int)):
- self.set_default_taxes(cr, uid, ids, {'tax_value': [tax_value]}, context=context)
+ def onchange_tax_policy(self, cr, uid, ids, tax_policy, context=None):
self.set_tax_policy(cr, uid, ids, {'tax_policy': tax_policy}, context=context)
- return res
+ return {'value': {}}
def set_default_taxes(self, cr, uid, ids, vals, context=None):
ir_values_obj = self.pool.get('ir.values')
diff --git a/addons/sale/res_config_view.xml b/addons/sale/res_config_view.xml
index 5eb77eee6a5..04cf914feca 100644
--- a/addons/sale/res_config_view.xml
+++ b/addons/sale/res_config_view.xml
@@ -5,87 +5,65 @@
Sales Applicationres.configform
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Configure Sales Application
- ir.actions.act_window
- res.config
-
- form
- form
-
-
-
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 76b2f6d4bcb..a99377c6289 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -270,7 +270,7 @@ class sale_order(osv.osv):
'payment_term': fields.many2one('account.payment.term', 'Payment Term'),
'fiscal_position': fields.many2one('account.fiscal.position', 'Fiscal Position'),
'company_id': fields.related('shop_id','company_id',type='many2one',relation='res.company',string='Company',store=True,readonly=True),
- 'tax_id': fields.many2one('account.tax','Global Tax'),
+ 'tax_id': fields.many2one('account.tax', 'Tax'),
}
_defaults = {
'picking_policy': 'direct',
@@ -310,6 +310,14 @@ class sale_order(osv.osv):
if shop.pricelist_id.id:
v['pricelist_id'] = shop.pricelist_id.id
return {'value': v}
+
+ def onchange_taxes(self, cr, uid, ids, tax_id, context=None):
+ sol_obj = self.pool.get('sale.order.line')
+ res = {'value': {}}
+ for order in self.browse(cr, uid, ids, context=context):
+ for line in order.order_line:
+ sol_obj.write(cr, uid, line.id, {'tax_id': [(4,tax_id)]})
+ return res
def action_cancel_draft(self, cr, uid, ids, *args):
if not len(ids):
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 4cdacbfc505..541bdf79f68 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -155,7 +155,8 @@
-
+
@@ -195,7 +196,7 @@
-
+