[IMP]: Improved tooltips. Improved views. Added default_get method to server. Added groups to hidden category.

bzr revid: uco@tinyerp.com-20120302113931-18fsygevyym7e14q
This commit is contained in:
Ujjvala Collins (OpenERP) 2012-03-02 17:09:31 +05:30
parent 9fba1f1526
commit 7371412505
5 changed files with 51 additions and 36 deletions

View File

@ -25,11 +25,11 @@ class crm_configuration(osv.osv_memory):
_inherit = 'res.config'
_columns = {
'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.
'module_crm_caldav' : fields.boolean("Caldav Synchronization",
help="""Allows 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,
Allows you to configure your incoming mail server. And creates leads for your mails.
It installs fetchmail_crm module."""),
'server' : fields.char('Server Name', size=256),
'port' : fields.integer('Port'),
@ -42,7 +42,7 @@ class crm_configuration(osv.osv_memory):
'user' : fields.char('Username', size=256),
'password' : fields.char('Password', size=1024),
'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.
help="""Import SugarCRM Leads, Opportunities, Users, Accounts, Contacts, Employees, Meetings, Phonecalls, Emails, and Project, Project Tasks Data.
It installs import_sugarcrm module.
"""),
'module_import_google' : fields.boolean("Google Import",
@ -60,12 +60,12 @@ class crm_configuration(osv.osv_memory):
It lets you define:
* contacts unrelated to a partner,
* contacts working at several addresses (possibly for different partners),
* contacts with possibly different functions for each of its job's addresses
* contacts with possibly different functions for each of its job's addresses.
It installs base_contact module.
"""),
'module_google_map' : fields.boolean("Google maps on customer",
help="""
This allows yopu to locate customer on Google Map.
Allows you to locate customer on Google Map.
It installs google_map module.
"""),
'module_plugin_thunderbird': fields.boolean('Thunderbird plugin',
@ -90,6 +90,21 @@ class crm_configuration(osv.osv_memory):
_defaults = {
'type': 'pop',
}
def create(self, cr, uid, vals, context=None):
ids = super(crm_configuration, self).create(cr, uid, vals, context=context)
self.execute(cr, uid, [ids], vals, context=context)
return ids
def write(self, cr, uid, ids, vals, context=None):
self.execute(cr, uid, ids, vals, context=context)
return super(crm_configuration, self).write(cr, uid, ids, vals, context=context)
def execute(self, cr, uid, ids, vals, context=None):
for method in dir(self):
if method.startswith('set_'):
getattr(self, method)(cr, uid, ids, vals, context)
return True
def get_default_email_configurations(self, cr, uid, ids, context=None):
ir_values_obj = self.pool.get('ir.values')
@ -129,11 +144,13 @@ 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, ids, context) or not server_ids:
tt = fetchmail_obj.create(cr, uid, fetchmail_vals, context=context)
installed_modules = self.get_default_installed_modules(cr, uid, ids, context=context)
if installed_modules.get('module_fetchmail_crm') or not server_ids:
server_ids = [fetchmail_obj.create(cr, uid, fetchmail_vals, context=context)]
else:
fetchmail_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads')], context=context)
fetchmail_obj.write(cr, uid, fetchmail_ids, fetchmail_vals, context=context)
server_ids = fetchmail_obj.search(cr, uid, [('name','=','Incoming Leads')], context=context)
fetchmail_obj.write(cr, uid, server_ids, fetchmail_vals, context=context)
fetchmail_obj.button_confirm_login(cr, uid, server_ids, context=None)
ir_values_obj.set(cr, uid, 'default', False, 'server', ['fetchmail.server'], fetchmail_vals.get('server'))
ir_values_obj.set(cr, uid, 'default', False, 'port', ['fetchmail.server'], fetchmail_vals.get('port'))
ir_values_obj.set(cr, uid, 'default', False, 'is_ssl', ['fetchmail.server'], fetchmail_vals.get('is_ssl'))

View File

@ -20,7 +20,7 @@
<group col="4" colspan="2">
<separator string="Emails" colspan="4"/>
<field name="module_fetchmail_crm" />
<field name="module_fetchmail_crm"/>
<newline/>
<group col="4" colspan="2"
attrs="{'invisible': [('module_fetchmail_crm','=',False)]}">

View File

@ -21,10 +21,12 @@
<record id="base.group_sale_pricelist_per_customer" model="res.groups">
<field name="name">Sales Pricelists</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_sale_uom_per_product" model="res.groups">
<field name="name">Product UOM</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_user" model="res.groups">

View File

@ -33,11 +33,11 @@ class sale_configuration(osv.osv_memory):
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="""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.
the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways
and to automatically creates project tasks from procurement lines.
It installs the project_timesheet and project_mrp module"""),
It installs the project_timesheet and project_mrp modules."""),
'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,
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([
@ -46,43 +46,44 @@ class sale_configuration(osv.osv_memory):
], 'Main Method Based On', required=True, help="You can generate invoices based on sales orders or based on shippings."),
'module_delivery': fields.boolean('Do you charge the delivery?',
help ="""
Allows you to add delivery methods in sale orders and picking,
Allows you to add delivery methods in sale orders and delivery orders.
You can define your own carrier and delivery grids for prices.
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 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_delivery_address':fields.boolean("Multiple Address",help="Allows you to set different delivery address and invoice 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.
Warning messages can be displayed for objects like sale order, purchase order, picking and invoice. The message is triggered by the form's onchange event.
help="""To raise user specific warning messages on different products used in Sales Orders, Purchase Orders, Invoices and Deliveries.
It installs the warning module."""),
'module_sale_margin': fields.boolean("Display Margin For Users",
help="""This adds the 'Margin' on sales order,
help="""This adds the 'Margin' on sales order.
This gives the profitability by calculating the difference between the Unit Price and Cost Price.
.It installs the sale_margin module."""),
'module_sale_journal': fields.boolean("Invoice journal?",
help="""This allows you to categorise your sales and deliveries (picking lists) between different journals.
It installs the sale_margin module."""),
'module_sale_journal': fields.boolean("Invoice Journal",
help="""Allows you to categorize your sales and deliveries (picking lists) between different journals.
It installs the sale_journal module."""),
'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."""),
help="""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."""),
'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.
help="""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.
""")
}
def get_default_installed_modules(self, cr, uid, ids, context=None):
data_obj = self.pool.get('ir.model.data')
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})
installed_modules.update({'time_unit': uom_id})
return installed_modules
def get_default_sale_configs(self, cr, uid, ids, context=None):
@ -103,14 +104,6 @@ class sale_configuration(osv.osv_memory):
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)
for method in dir(self):
if method.startswith('get_default_'):
result.update(getattr(self, method)(cr, uid, [], context))
return result
_defaults = {
'order_policy': 'manual',
'time_unit': lambda self, cr, uid, c: self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c) and self.pool.get('product.uom').search(cr, uid, [('name', '=', _('Hour'))], context=c)[0] or False,
@ -126,7 +119,6 @@ class sale_configuration(osv.osv_memory):
return super(sale_configuration, self).write(cr, uid, ids, vals, context=context)
def execute(self, cr, uid, ids, vals, context=None):
#TODO: TO BE IMPLEMENTED
for method in dir(self):
if method.startswith('set_'):
getattr(self, method)(cr, uid, ids, vals, context)

View File

@ -22,18 +22,22 @@
<record id="base.group_sale_delivery_address" model="res.groups">
<field name="name">Addresses in Sale Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_sale_disc_per_sale_order_line" model="res.groups">
<field name="name">Discount on lines</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_sale_taxes_global_on_order" model="res.groups">
<field name="name">Sales Taxes Global on Order</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_sale_taxes_on_order_line" model="res.groups">
<field name="name">Sales Taxes on Order Lines</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.group_user" model="res.groups">