From b53cf8d33fc6435592f8b9ef681af85234eb7a5f Mon Sep 17 00:00:00 2001 From: "Turkesh Patel (Open ERP)" Date: Fri, 2 Mar 2012 14:18:46 +0530 Subject: [PATCH] [IMP] Improved code. added group on UOM field improved tooltip and changes in groups bzr revid: tpa@tinyerp.com-20120302084846-ighfb6dsggw97z1k --- addons/account/res_config.py | 11 +++++-- addons/crm/res_config.py | 21 +++++++++----- addons/crm/res_config_view.xml | 14 ++++----- addons/product/product_view.xml | 14 ++++----- addons/product/res_config.py | 14 +++++++-- addons/product/security/product_security.xml | 6 ++-- addons/sale/res_config.py | 30 +++++++++++++------- addons/sale/security/sale_security.xml | 6 +--- 8 files changed, 69 insertions(+), 47 deletions(-) diff --git a/addons/account/res_config.py b/addons/account/res_config.py index b07abeb85fc..92692084b75 100644 --- a/addons/account/res_config.py +++ b/addons/account/res_config.py @@ -30,14 +30,19 @@ 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), + ], '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. + """), 'tax_value': fields.float('Value'), } - + _defaults = { 'tax_policy': 'global_on_order', } - + def get_default_tax_policy(self, cr, uid, ids, context=None): applied_groups = self.get_default_applied_groups(cr, uid, ids, context=context) if applied_groups.get('group_sale_taxes_global_on_order'): diff --git a/addons/crm/res_config.py b/addons/crm/res_config.py index 1082052344c..7657982c93d 100644 --- a/addons/crm/res_config.py +++ b/addons/crm/res_config.py @@ -25,9 +25,16 @@ class crm_configuration(osv.osv_memory): _inherit = 'res.config' _columns = { - 'module_crm_caldav' : fields.boolean("Use caldav to synchronize Meetings", - help="Install crm_caldav module: Caldav features in Meeting"), - 'fetchmail_crm': fields.boolean("Lead/Opportunity mail gateway"), + '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. + """), 'server' : fields.char('Server Name', size=256), 'port' : fields.integer('Port'), 'type': fields.selection([ @@ -38,13 +45,13 @@ class crm_configuration(osv.osv_memory): 'is_ssl': fields.boolean('SSL/TLS', help="Connections are encrypted with SSL/TLS through a dedicated port (default: IMAPS=993, POP=995)"), 'user' : fields.char('Username', size=256), 'password' : fields.char('Password', size=1024), - 'module_import_sugarcrm' : fields.boolean("Import data from sugarCRM?", + 'module_import_sugarcrm' : fields.boolean("SugarCRM Import", help="""Import SugarCRM Leads, Opportunities, Users, Accounts, Contacts, Employees, Meetings, Phonecalls, Emails, and Project, Project Tasks Data into OpenERP Module. It installs import_sugarcrm module. """), - 'module_import_google' : fields.boolean("Import Contacts & Meetings from Google", + 'module_import_google' : fields.boolean("Google Import", help=""" - Import google contact in partner address and add google calendar events details in Meeting + Import google contact in partner address and add google calendar events details in Meeting. It installs import_google module. """), 'module_wiki_sale_faq' : fields.boolean("Install a sales FAQ?", @@ -62,7 +69,7 @@ class crm_configuration(osv.osv_memory): """), 'module_google_map' : fields.boolean("Google maps on customer", help=""" - This allows yopu to locate customer on Google Map + This allows yopu to locate customer on Google Map. It installs google_map module. """), 'module_plugin_thunderbird': fields.boolean('Thunderbird plugin', diff --git a/addons/crm/res_config_view.xml b/addons/crm/res_config_view.xml index 66130eae4a8..8fd35eb0ab5 100644 --- a/addons/crm/res_config_view.xml +++ b/addons/crm/res_config_view.xml @@ -20,17 +20,17 @@ - + - - - + attrs="{'invisible': [('module_fetchmail_crm','=',False)]}"> + + + - - + + diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index a1857748b9d..6aca544a295 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -50,7 +50,7 @@ - + @@ -87,7 +87,7 @@ - + @@ -125,11 +125,11 @@ - + - + @@ -440,7 +440,7 @@ Create and manage the units of measure you want to be used in your system. You can define a conversion rate between several Units of Measure within the same category. - + @@ -674,11 +674,11 @@ - + - + diff --git a/addons/product/res_config.py b/addons/product/res_config.py index 5211f302bb9..3c92e97a879 100644 --- a/addons/product/res_config.py +++ b/addons/product/res_config.py @@ -25,8 +25,16 @@ class product_groups_configuration(osv.osv_memory): _inherit = 'res.config' _columns = { - 'group_sale_pricelist_per_customer':fields.boolean("Pricelist per customer ",help="Group to Activate pricelist to manage prices per customer"), - 'group_sale_uom_per_product':fields.boolean("UOM per product",help="Group to Allow different unit of measure per product"), + '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_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 + """), } - + product_groups_configuration() \ No newline at end of file diff --git a/addons/product/security/product_security.xml b/addons/product/security/product_security.xml index 4fba712c00a..a4cebc9b3d3 100644 --- a/addons/product/security/product_security.xml +++ b/addons/product/security/product_security.xml @@ -18,17 +18,15 @@ Product Variant - + Sales Pricelists - Product UOM - - + diff --git a/addons/sale/res_config.py b/addons/sale/res_config.py index 0eb580c10c7..33cf3207bd8 100644 --- a/addons/sale/res_config.py +++ b/addons/sale/res_config.py @@ -39,12 +39,13 @@ class sale_configuration(osv.osv_memory): 'deli_orders': fields.boolean('Based on Delivery Orders'), 'task_work': fields.boolean('Based on Tasks\' Work', help=""" - It installs the project_timesheet and project_mrp module - project_timesheet :lets you transfer the entries under tasks defined for Project Management to + This allows to 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. - project_mrp : Automatically creates project tasks from procurement lines"""), + Automatically creates project tasks from procurement lines. + It installs the project_timesheet and project_mrp module. + """), 'timesheet': fields.boolean('Based on Timesheet', - help = """for modifying account analytic view to show important data to project manager of services companies, + 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."""), 'order_policy': fields.selection([ @@ -58,9 +59,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 = ""), - 'group_sale_delivery_address':fields.boolean("Multiple Address",help="Group To Allow delivery address different from invoice address"), - 'group_sale_disc_per_sale_order_line':fields.boolean("Discounts per sale order lines ",help="Group to apply discounts per sale order lines"), + '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."), '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. @@ -76,7 +77,7 @@ class sale_configuration(osv.osv_memory): 'module_analytic_user_function' : fields.boolean("User function by contracts", help="""This allows you to define what is the default function of a specific user on a given account This is mostly used when a user encodes his timesheet: the values are retrieved and the fields are auto-filled. But the possibility to change these values is still available. - It Installs analytic_user_function module"""), + It Installs analytic_user_function module."""), '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. @@ -84,8 +85,8 @@ class sale_configuration(osv.osv_memory): '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."""), + 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): @@ -108,6 +109,7 @@ class sale_configuration(osv.osv_memory): 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'])], @@ -115,10 +117,16 @@ class sale_configuration(osv.osv_memory): 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 + 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): ir_values_obj = self.pool.get('ir.values') data_obj = self.pool.get('ir.model.data') diff --git a/addons/sale/security/sale_security.xml b/addons/sale/security/sale_security.xml index 315433447ac..b902e8f5307 100644 --- a/addons/sale/security/sale_security.xml +++ b/addons/sale/security/sale_security.xml @@ -22,22 +22,18 @@ Addresses in Sale Orders - Discount on lines - Sales Taxes Global on Order - - + Sales Taxes on Order Lines -