[IMP]: Improved views, code according to new specifications. Improved tooltips

bzr revid: uco@tinyerp.com-20120302085038-z8isyuwxhw7vp6hh
This commit is contained in:
Ujjvala Collins (OpenERP)
2012-03-02 14:20:38 +05:30
parent e7aafa3f80
commit 4be6bcc9b1
12 changed files with 147 additions and 148 deletions
+1 -1
View File
@@ -59,7 +59,7 @@
<field name="action_id" ref="action_account_configuration_installer"/>
<field name="category_id" ref="category_accounting_configuration"/>
<field name="sequence">3</field>
<field name="type">manual</field>
<field name="type">automatic</field>
</record>
<record id="action_view_financial_accounts_installer" model="ir.actions.act_window">
+7 -3
View File
@@ -30,12 +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),
], '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):
@@ -98,7 +102,7 @@ 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)]})
@@ -117,11 +117,13 @@
<field name="inherit_id" ref="sale.view_sales_config"/>
<field name="type">form</field>
<field name="arch" type="xml">
<field name="module_account_analytic_analysis" position="after">
<newline/>
<field name="module_analytic_user_function" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
<field name="module_analytic_journal_billing_rate" attrs="{'invisible': [('account_analytic_analysis','=',False)]}"/>
</field>
<group name="sale_order" position="after">
<group col="4" colspan="4">
<separator string="Contracts" colspan="4"/>
<field name="module_analytic_user_function" attrs="{'invisible': [('module_account_analytic_analysis','=',False)]}"/>
<field name="module_analytic_journal_billing_rate" attrs="{'invisible': [('module_account_analytic_analysis','=',False)]}"/>
</group>
</group>
</field>
</record>
+10 -7
View File
@@ -26,8 +26,11 @@ class crm_configuration(osv.osv_memory):
_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"),
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([
@@ -92,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
@@ -113,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'),
@@ -126,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)
+30 -27
View File
@@ -5,34 +5,34 @@
<field name="name">Sales Application</field>
<field name="model">res.config</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="inherit_id" ref="base.res_config_view_for_all"/>
<field name="arch" type="xml">
<xpath expr="//form/group[@name='Contracts']" position="after">
<group col="8" colspan="4" name="emails">
<group col="4" colspan="2">
<separator string="Plugins" colspan="4"/>
<newline/>
<field name="module_plugin_thunderbird" colspan="2"/>
<newline/>
<field name="module_plugin_outlook" colspan="2"/>
<newline/>
</group>
<group name="crm" position="inside">
<group col="8" colspan="4" name="emails">
<group col="4" colspan="2">
<separator string="Plugins" colspan="4"/>
<newline/>
<field name="module_plugin_thunderbird" colspan="2"/>
<newline/>
<field name="module_plugin_outlook" colspan="2"/>
<newline/>
</group>
<group col="4" colspan="2">
<separator string="Emails" colspan="4"/>
<field name="fetchmail_crm" />
<newline/>
<group col="4" colspan="2"
attrs="{'invisible': [('fetchmail_crm','=',False)]}">
<field name="server" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="type" nolabel="1" on_change="onchange_server_type(type, is_ssl)" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="port" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="is_ssl" on_change="onchange_server_type(type, is_ssl)"/>
<newline/>
<field name="user" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
<field name="password" password="True" attrs="{'required': [('fetchmail_crm','=',True)]}"/>
</group>
</group>
<group col="4" colspan="2">
<separator string="Emails" colspan="4"/>
<field name="module_fetchmail_crm" />
<newline/>
<group col="4" colspan="2"
attrs="{'invisible': [('module_fetchmail_crm','=',False)]}">
<field name="server" attrs="{'required': [('module_fetchmail_crm','=',True)]}"/>
<field name="type" nolabel="1" on_change="onchange_server_type(type, is_ssl)" attrs="{'required': [('module_fetchmail_crm','=',True)]}"/>
<field name="port" attrs="{'required': [('module_fetchmail_crm','=',True)]}"/>
<field name="is_ssl" on_change="onchange_server_type(type, is_ssl)"/>
<newline/>
<field name="user" attrs="{'required': [('module_fetchmail_crm','=',True)]}"/>
<field name="password" password="True" attrs="{'required': [('module_fetchmail_crm','=',True)]}"/>
</group>
</group>
</group>
<group colspan="4" col="4" name="synchronization">
@@ -59,8 +59,11 @@
<field name="module_google_map"/>
</group>
</group>
</xpath>
</group>
</field>
</record>
<menuitem id="base.menu_sale_config" name="Sales" parent="base.menu_config" sequence="1" action="base.action_sale_config"/>
</data>
</openerp>
+2 -2
View File
@@ -52,9 +52,9 @@
<field name="name">Sales Application</field>
<field name="model">res.config</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="inherit_id" ref="base.res_config_view_for_all"/>
<field name="arch" type="xml">
<field name="plugin_outlook" position="after">
<field name="module_plugin_outlook" position="after">
<button name="%(action_outlook_installer)d" type="action" string="Configure" icon="gtk-execute"/>
</field>
</field>
@@ -59,9 +59,9 @@
<field name="name">Sales Application</field>
<field name="model">res.config</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="inherit_id" ref="base.res_config_view_for_all"/>
<field name="arch" type="xml">
<field name="plugin_thunderbird" position="after">
<field name="module_plugin_thunderbird" position="after">
<button name="%(action_thunderbird_installer)d" type="action" string="Configure" icon="gtk-execute"/>
</field>
</field>
+9 -2
View File
@@ -25,8 +25,15 @@ 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, etc.
It assigns the "Pricelist" group to all employees."""),
'group_sale_uom_per_product':fields.boolean("UOM per product",
help="""
Allows you to select and maintain different unit of measures per product.
It assigns the "UOM per product" group to all employees.
"""),
}
product_groups_configuration()
+16 -27
View File
@@ -27,18 +27,19 @@ 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="""
It installs the project_timesheet and project_mrp module
project_timesheet :lets 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.
project_mrp : Automatically creates project tasks from procurement lines"""),
'timesheet': 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."""),
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."""),
'order_policy': fields.selection([
('manual', 'Invoice Based on Sales Orders'),
('picking', 'Invoice Based on Deliveries'),
@@ -50,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 = ""),
'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 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.
@@ -73,19 +74,12 @@ class sale_configuration(osv.osv_memory):
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_installed_modules(self, cr, uid, ids, context=None):
installed_modules = super(sale_configuration, self).get_default_installed_modules(cr, uid, ids, context=context)
if installed_modules.get('project_mrp') and installed_modules.get('project_timesheet'):
if installed_modules.get('module_project_mrp') and installed_modules.get('module_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):
@@ -136,11 +130,6 @@ class sale_configuration(osv.osv_memory):
return True
def set_installed_modules(self, cr, uid, ids, vals, context=None):
if vals.get('timesheet'):
vals.update({'module_account_analytic_analysis': True})
else:
vals.update({'module_account_analytic_analysis': False})
if vals.get('task_work'):
vals.update({'module_project_timesheet': True, 'module_project_mrp': True})
else:
+51 -69
View File
@@ -5,83 +5,65 @@
<field name="name">Sales Application</field>
<field name="model">res.config</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.res_config_view_base"/>
<field name="inherit_id" ref="base.res_config_view_for_all"/>
<field name="arch" type="xml">
<form position="replace">
<form string="Sale Configuration">
<separator string="Picking and Invoice Policy" colspan="4"/>
<group colspan="4" col="8">
<group colspan="4" col="4">
<field name="sale_orders"/>
<newline/>
<field name="deli_orders"/>
<newline/>
<field name="task_work"/>
<newline/>
<field name="timesheet"/>
<newline/>
</group>
<group colspan="4" col="4">
<field name="order_policy" attrs="{'invisible':['|',('sale_orders','=',False),('deli_orders','=',False)]}"/>
<newline/>
<field name="module_delivery" attrs="{'invisible':[('sale_orders','=',False), ('deli_orders','=',False)]}"/>
<newline/>
<field name="picking_policy" attrs="{'invisible':[('deli_orders','=',False)]}"/>
<newline/>
<field name="time_unit" domain="[('category_id.name','=','Working Time')]" attrs="{'invisible':[('task_work','=',False),('timesheet','=',False)],'required': [('timesheet','=',True)]}"/>
</group>
<group name="sales" position="inside">
<separator string="Picking and Invoice Policy" colspan="4"/>
<group colspan="4" col="8">
<group colspan="4" col="4">
<field name="sale_orders"/>
<newline/>
<field name="deli_orders"/>
<newline/>
<field name="task_work"/>
<newline/>
<field name="module_account_analytic_analysis"/>
<newline/>
</group>
<separator string="Sale Order" colspan="4"/>
<group colspan="4" col="8">
<group colspan="4" col="4">
<field name="group_sale_pricelist_per_customer"/>
<newline/>
<field name="tax_policy" on_change="onchange_tax_policy(tax_policy)"/>
<newline/>
<field name="module_sale_margin"/>
<newline/>
<field name="module_warning"/>
<newline/>
</group>
<group colspan="4" col="4">
<newline/>
<field name="group_sale_uom_per_product"/>
<newline/>
<field name="group_sale_delivery_address"/>
<newline/>
<field name="group_sale_disc_per_sale_order_line"/>
<newline/>
<field name="module_sale_layout"/>
<newline/>
<field name="module_sale_journal"/>
<newline/>
</group>
<group colspan="4" col="4">
<field name="order_policy" attrs="{'invisible':['|',('sale_orders','=',False),('deli_orders','=',False)]}"/>
<newline/>
<field name="module_delivery" attrs="{'invisible':[('sale_orders','=',False), ('deli_orders','=',False)]}"/>
<newline/>
<field name="picking_policy" attrs="{'invisible':[('deli_orders','=',False)]}"/>
<newline/>
<field name="time_unit" domain="[('category_id.name','=','Working Time')]" attrs="{'invisible':[('task_work','=',False),('module_account_analytic_analysis','=',False)],'required': [('module_account_analytic_analysis','=',True)]}"/>
</group>
</group>
<separator string="Contracts" colspan="4"/>
<group name="Contracts" colspan="4" col="4">
<group colspan="4" col="4">
<field name="module_account_analytic_analysis"/>
<newline/>
</group>
<separator string="Sale Order" colspan="4"/>
<group colspan="4" col="8" name="sale_order">
<group colspan="4" col="4">
<field name="group_sale_pricelist_per_customer"/>
<newline/>
<group col="2" colspan="1">
<field name="tax_policy" on_change="onchange_tax_policy(tax_policy)"/>
</group>
<newline/>
<field name="module_sale_margin"/>
<newline/>
<field name="module_warning"/>
<newline/>
</group>
</form>
</form>
<group colspan="4" col="4">
<newline/>
<field name="group_sale_uom_per_product"/>
<newline/>
<field name="group_sale_delivery_address"/>
<newline/>
<field name="group_sale_disc_per_sale_order_line"/>
<newline/>
<field name="module_sale_layout"/>
<newline/>
<field name="module_sale_journal"/>
<newline/>
</group>
</group>
</group>
</field>
</record>
<record id="action_sale_config" model="ir.actions.act_window">
<field name="name">Configure Sales Application</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config</field>
<field name="view_id" ref="view_sales_config"/>
<field name="view_type">form</field>
<field name="view_mode">form</field>
</record>
<menuitem id="menu_sale_config" name="Sales" parent="base.menu_config" sequence="1" action="action_sale_config"/>
<menuitem id="base.menu_sale_config" name="Sales" parent="base.menu_config" sequence="1" action="base.action_sale_config"/>
</data>
</openerp>
+9 -1
View File
@@ -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):
+3 -2
View File
@@ -155,7 +155,8 @@
<separator colspan="5" string="Notes" groups="base.group_sale_notes_subtotal"/>
<field colspan="5" name="notes" nolabel="1" groups="base.group_sale_notes_subtotal"/>
<separator colspan="5" string="Taxes" groups="base.group_sale_taxes_on_order_line"/>
<field colspan="5" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]" groups="base.group_sale_taxes_on_order_line"/>
<field colspan="5" name="tax_id" nolabel="1" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]"
groups="base.group_sale_taxes_on_order_line" />
<group colspan="5" col="5" groups="base.group_extended">
<separator colspan="5" string="States"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirmed,done" statusbar_colors='{"exception":"red","cancel":"red"}'/>
@@ -195,7 +196,7 @@
</field>
<newline/>
<group col="13" colspan="10">
<field name="tax_id" groups="base.group_sale_taxes_global_on_order"/>
<field name="tax_id" groups="base.group_sale_taxes_global_on_order" on_change="onchange_taxes(tax_id)"/>
<field name="amount_untaxed" sum="Untaxed amount" groups="base.group_sale_taxes_on_order_line,base.group_sale_taxes_global_on_order"/>
<field name="amount_tax" groups="base.group_sale_taxes_on_order_line,base.group_sale_taxes_global_on_order"/>
<field name="amount_total"/>