diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py
index fbe3f71e024..8861a59c368 100644
--- a/openerp/addons/base/ir/ir_actions.py
+++ b/openerp/addons/base/ir/ir_actions.py
@@ -210,10 +210,6 @@ class act_window(osv.osv):
res[act.id] = str(field_get)
return res
- def _get_help_status(self, cr, uid, ids, name, arg, context=None):
- activate_tips = self.pool.get('res.users').browse(cr, uid, uid).menu_tips
- return dict([(id, activate_tips) for id in ids])
-
_columns = {
'name': fields.char('Action Name', size=64, translate=True),
'type': fields.char('Action Type', size=32, required=True),
@@ -222,9 +218,10 @@ class act_window(osv.osv):
help="Optional domain filtering of the destination data, as a Python expression"),
'context': fields.char('Context Value', size=250, required=True,
help="Context dictionary as Python expression, empty by default (Default: {})"),
- 'res_model': fields.char('Object', size=64, required=True,
+ 'res_id': fields.integer('Record ID', help="Database ID of record to open in form view, when ``view_mode`` is set to 'form' only"),
+ 'res_model': fields.char('Destination Model', size=64, required=True,
help="Model name of the object to open in the view window"),
- 'src_model': fields.char('Source Object', size=64,
+ 'src_model': fields.char('Source Model', size=64,
help="Optional model name of the objects on which this action should be visible"),
'target': fields.selection([('current','Current Window'),('new','New Window'),('inline','Inline')], 'Target Window'),
'view_type': fields.selection((('tree','Tree'),('form','Form')), string='View Type', required=True,
@@ -250,8 +247,6 @@ class act_window(osv.osv):
'help': fields.text('Action description',
help='Optional help text for the users with a description of the target view, such as its usage and purpose.',
translate=True),
- 'display_menu_tip':fields.function(_get_help_status, type='boolean', string='Display Menu Tips',
- help='It gives the status if the tip has to be displayed or not when a user executes an action'),
'multi': fields.boolean('Action on Multiple Doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view"),
}
diff --git a/openerp/addons/base/ir/ir_config_parameter_view.xml b/openerp/addons/base/ir/ir_config_parameter_view.xml
index 3df9b80551c..6b1c6c4f86e 100644
--- a/openerp/addons/base/ir/ir_config_parameter_view.xml
+++ b/openerp/addons/base/ir/ir_config_parameter_view.xml
@@ -40,7 +40,6 @@
-
+
diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py
index beed30a2178..42b582f38b6 100644
--- a/openerp/addons/base/ir/ir_model.py
+++ b/openerp/addons/base/ir/ir_model.py
@@ -96,9 +96,9 @@ class ir_model(osv.osv):
'field_id': fields.one2many('ir.model.fields', 'model_id', 'Fields', required=True),
'state': fields.selection([('manual','Custom Object'),('base','Base Object')],'Type',readonly=True),
'access_ids': fields.one2many('ir.model.access', 'model_id', 'Access'),
- 'osv_memory': fields.function(_is_osv_memory, string='In-Memory Model', type='boolean',
+ 'osv_memory': fields.function(_is_osv_memory, string='Transient Model', type='boolean',
fnct_search=_search_osv_memory,
- help="Indicates whether this object model lives in memory only, i.e. is not persisted (osv.osv_memory)"),
+ help="This field specifies whether the model is transient or not (i.e. if records are automatically deleted from the database or not)"),
'modules': fields.function(_in_modules, type='char', size=128, string='In Modules', help='List of modules in which the object is defined or inherited'),
'view_ids': fields.function(_view_ids, type='one2many', obj='ir.ui.view', string='Views'),
}
@@ -225,7 +225,7 @@ class ir_model_fields(osv.osv):
'required': fields.boolean('Required'),
'readonly': fields.boolean('Readonly'),
'select_level': fields.selection([('0','Not Searchable'),('1','Always Searchable'),('2','Advanced Search (deprecated)')],'Searchable', required=True),
- 'translate': fields.boolean('Translate', help="Whether values for this field can be translated (enables the translation mechanism for that field)"),
+ 'translate': fields.boolean('Translatable', help="Whether values for this field can be translated (enables the translation mechanism for that field)"),
'size': fields.integer('Size'),
'state': fields.selection([('manual','Custom Field'),('base','Base Field')],'Type', required=True, readonly=True, select=1),
'on_delete': fields.selection([('cascade','Cascade'),('set null','Set NULL')], 'On Delete', help='On delete property for many2one fields'),
diff --git a/openerp/addons/base/ir/ir_needaction.py b/openerp/addons/base/ir/ir_needaction.py
index 75a6c6cb523..0f28c33ded9 100644
--- a/openerp/addons/base/ir/ir_needaction.py
+++ b/openerp/addons/base/ir/ir_needaction.py
@@ -24,16 +24,16 @@ from operator import itemgetter
from osv import osv, fields
from tools.translate import _
-class ir_needaction_users_rel(osv.osv):
- '''
- ir_needaction_users_rel holds data related to the needaction
- mechanism inside OpenERP. A row in this model is characterized by:
+class ir_needaction_users_rel(osv.Model):
+ ''' ir_needaction_users_rel holds data related to the needaction
+ mechanism inside OpenERP. A row in this model is characterized
+ by:
- res_model: model of the record requiring an action
- res_id: ID of the record requiring an action
- - user_id: foreign key to the res.users table, to the user that
- has to perform the action
- This model can be seen as a many2many, linking (res_model, res_id) to
- users (those whose attention is required on the record).'''
+ - user_id: foreign key to the res.users table, to the user that has to
+ perform the action
+ This model can be seen as a many2many, linking (res_model, res_id) to users
+ (those whose attention is required on the record). '''
_name = 'ir.needaction_users_rel'
_description = 'Needaction relationship table'
@@ -78,50 +78,47 @@ class ir_needaction_users_rel(osv.osv):
return True
-class ir_needaction_mixin(osv.osv):
+class ir_needaction_mixin(osv.Model):
'''Mixin class for objects using the need action feature.
- Need action feature can be used by objects willing to be able to
- signal that an action is required on a particular record. If in the
- business logic an action must be performed by somebody, for instance
- validation by a manager, this mechanism allows to set a list of
- users asked to perform an action.
+ Need action feature can be used by objects having to be able to
+ signal that an action is required on a particular record. If in
+ the business logic an action must be performed by somebody, for
+ instance validation by a manager, this mechanism allows to set a
+ list of users asked to perform an action.
- This class wraps a class (ir.ir_needaction_users_rel) that behaves
- like a many2many field. However, no field is added to the model
- inheriting from this mixin class. This class handles the low-level
- considerations of updating relationships. Every change made on the
- record calls a method that updates the relationships.
+ This class wraps a class (ir.ir_needaction_users_rel) that
+ behaves like a many2many field. This class handles the low-level
+ considerations of updating relationships. Every change made on
+ the record calls a method that updates the relationships.
- Objects using the 'need_action' feature should override the
- ``get_needaction_user_ids`` method. This methods returns a dictionary
- whose keys are record ids, and values a list of user ids, like
- in a many2many relationship. Therefore by defining only one method,
- you can specify if an action is required by defining the users
- that have to do it, in every possible situation.
+ Objects using the 'need_action' feature should override the
+ ``get_needaction_user_ids`` method. This methods returns a
+ dictionary whose keys are record ids, and values a list of user
+ ids, like in a many2many relationship. Therefore by defining
+ only one method, you can specify if an action is required by
+ defining the users that have to do it, in every possible
+ situation.
- This class also offers several global services,:
+ This class also offers several global services:
- ``needaction_get_record_ids``: for the current model and uid, get
- all record ids that ask this user to perform an action. This
- mechanism is used for instance to display the number of pending
- actions in menus, such as Leads (12)
+ all record ids that ask this user to perform an action. This
+ mechanism is used for instance to display the number of pending
+ actions in menus, such as Leads (12)
- ``needaction_get_action_count``: as ``needaction_get_record_ids``
- but returns only the number of action, not the ids (performs a
- search with count=True)
- - ``needaction_get_user_record_references``: for a given uid, get all
- the records that ask this user to perform an action. Records
- are given as references, a list of tuples (model_name, record_id)
+ but returns only the number of action, not the ids (performs a
+ search with count=True)
- The ``ir_needaction_mixin`` class adds a function field on models inheriting
- from the class. This field allows to state whether a given record has
- a needaction for the current user. This is usefull if you want to customize
- views according to the needaction feature. For example, you may want to
- set records in bold in a list view if the current user has an action to
- perform on the record. This makes the class not a pure abstract class,
- but allows to easily use the action information.'''
+ The ``ir_needaction_mixin`` class adds a calculated field
+ ``needaction_pending``. This function field allows to state
+ whether a given record has a needaction for the current user.
+ This is usefull if you want to customize views according to the
+ needaction feature. For example, you may want to set records in
+ bold in a list view if the current user has an action to perform
+ on the record. '''
_name = 'ir.needaction_mixin'
- _description = '"Need action" mixin'
+ _description = 'Need action mixin'
def get_needaction_pending(self, cr, uid, ids, name, arg, context=None):
res = {}
@@ -129,13 +126,19 @@ class ir_needaction_mixin(osv.osv):
for id in ids:
res[id] = uid in needaction_user_ids[id]
return res
+
+ def search_needaction_pending(self, cr, uid, self_again, field_name, criterion, context=None):
+ ids = self.needaction_get_record_ids(
+ cr, uid, uid, limit=1024, context=context)
+ return [('id', 'in', ids)]
_columns = {
- 'needaction_pending': fields.function(get_needaction_pending, type='boolean',
- string='Need action pending',
- help='If True, this field states that users have to perform an action. \
- This field comes from the needaction mechanism. Please refer \
- to the ir.needaction_mixin class.'),
+ 'needaction_pending': fields.function(
+ get_needaction_pending, type='boolean',
+ fnct_search=search_needaction_pending,
+ string='Need action pending',
+ help="If True, this field states that users have to perform an " \
+ "action This field comes from the ir.needaction_mixin class."),
}
#------------------------------------------------------
@@ -146,7 +149,7 @@ class ir_needaction_mixin(osv.osv):
""" Returns the user_ids that have to perform an action
:return: dict { record_id: [user_ids], }
"""
- return dict.fromkeys(ids, [])
+ return dict((id,list()) for id in ids)
def create(self, cr, uid, values, context=None):
rel_obj = self.pool.get('ir.needaction_users_rel')
@@ -191,14 +194,5 @@ class ir_needaction_mixin(osv.osv):
get the number of actions it has to perform"""
rel_obj = self.pool.get('ir.needaction_users_rel')
return rel_obj.search(cr, uid, [('res_model', '=', self._name), ('user_id', '=', user_id)], limit=limit, count=True, context=context)
-
- def needaction_get_record_references(self, cr, uid, user_id, offset=None, limit=None, order=None, context=None):
- """For a given user_id, get all the records that asks this user to
- perform an action. Records are given as references, a list of
- tuples (model_name, record_id).
- This method is trans-model."""
- rel_obj = self.pool.get('ir.needaction_users_rel')
- rel_ids = rel_obj.search(cr, uid, [('user_id', '=', user_id)], offset=offset, limit=limit, order=order, context=context)
- return map(itemgetter('res_model', 'res_id'), rel_obj.read(cr, uid, rel_ids, ['res_model', 'res_id'], context=context))
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/openerp/addons/base/ir/wizard/wizard_menu_view.xml b/openerp/addons/base/ir/wizard/wizard_menu_view.xml
index a9c841a6d69..9f5d912ed1a 100644
--- a/openerp/addons/base/ir/wizard/wizard_menu_view.xml
+++ b/openerp/addons/base/ir/wizard/wizard_menu_view.xml
@@ -7,14 +7,15 @@
form
-
-
-
-
+
diff --git a/openerp/addons/base/ir/workflow/workflow_view.xml b/openerp/addons/base/ir/workflow/workflow_view.xml
index bda98b7c8c0..00662a68f29 100644
--- a/openerp/addons/base/ir/workflow/workflow_view.xml
+++ b/openerp/addons/base/ir/workflow/workflow_view.xml
@@ -15,14 +15,12 @@
form
diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py
index 9277184a822..3f4a052a36b 100644
--- a/openerp/addons/base/res/res_config.py
+++ b/openerp/addons/base/res/res_config.py
@@ -70,10 +70,14 @@ class res_config_configurable(osv.osv_memory):
res = next.action_launch(context=context)
res['nodestroy'] = False
return res
- #if there is no next action and if html is in the context: reload instead of closing
- if context and 'html' in context:
- return {'type' : 'ir.actions.reload'}
- return {'type' : 'ir.actions.act_window_close'}
+ # reload the client; open the first available root menu
+ menu_obj = self.pool.get('ir.ui.menu')
+ menu_ids = menu_obj.search(cr, uid, [('parent_id', '=', False)], context=context)
+ return {
+ 'type': 'ir.actions.client',
+ 'tag': 'reload',
+ 'params': {'menu_id': menu_ids and menu_ids[0] or False},
+ }
def start(self, cr, uid, ids, context=None):
return self.next(cr, uid, ids, context)
diff --git a/openerp/addons/base/res/res_config.xml b/openerp/addons/base/res/res_config.xml
index d9cc5414e69..37e50e91492 100644
--- a/openerp/addons/base/res/res_config.xml
+++ b/openerp/addons/base/res/res_config.xml
@@ -1,53 +1,54 @@
-
+
- res.config.view.base
- res.config
- form
-
-
+
- Inheritable view for installer objects
- res.config.installer
- form
-
-
-
-
-
-
-
-
-
+ Inheritable view for installer objects
+ res.config.installer
+ form
+
+
+
+
+
+
-
+
diff --git a/openerp/addons/base/res/res_country_view.xml b/openerp/addons/base/res/res_country_view.xml
index 6b28f065272..efb3b9eca06 100644
--- a/openerp/addons/base/res/res_country_view.xml
+++ b/openerp/addons/base/res/res_country_view.xml
@@ -41,7 +41,7 @@
Display and manage the list of all countries that can be assigned to your partner records. You can create or delete countries to make sure the ones you are working on will be maintained.
-
+
diff --git a/openerp/addons/base/res/res_currency_view.xml b/openerp/addons/base/res/res_currency_view.xml
index 1d37d8d1bba..c0a66a12daa 100644
--- a/openerp/addons/base/res/res_currency_view.xml
+++ b/openerp/addons/base/res/res_currency_view.xml
@@ -78,7 +78,7 @@
-
+
+
+
-
+
res.partner.title.treeres.partner.title
@@ -31,7 +33,6 @@
-
@@ -70,11 +71,8 @@
-
+
+
res.partner.treeres.partner
@@ -101,46 +99,31 @@
@@ -371,9 +364,17 @@
ir.actions.act_windowres.partnerform
+ kanban,tree,form[('customer','=',1)]{'default_customer':1, 'search_default_customer':1}
+
+ Click on "Create" to add a new customer in your address book.
+ <p>
+ A contact is either a person or a company; a person can be linked to a company as a contact of that company.
+ <p>
+ You will be able to follow documents and history of your contacts (invoices, meetings, projects, etc.)
+
@@ -385,7 +386,13 @@
kanban,tree,form{'search_default_supplier': 1,'default_customer': 0,'default_supplier': 1}
- You can access all information regarding your suppliers from the supplier form: accounting data, history of emails, meetings, purchases, etc. You can uncheck the 'Suppliers' filter button in order to search in all your partners, including customers and prospects.
+
+ Click on "Create" to add a new supplier in your address book.
+ <p>
+ A supplier is either a person or a company; a person can be linked to a company as a contact of that company.
+ <p>
+ You will be able to follow documents and history of your contacts (invoices, meetings, projects, etc.)
+
@@ -426,11 +433,8 @@
form
-
+
+
Partner Categoriesres.partner.category
@@ -509,4 +513,3 @@
-
diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py
index 606d9c13aaf..c8c4b84af57 100644
--- a/openerp/addons/base/res/res_users.py
+++ b/openerp/addons/base/res/res_users.py
@@ -233,7 +233,6 @@ class users(osv.osv):
help="The user's timezone, used to output proper date and time values inside printed reports. "
"It is important to set a value for this field. You should use the same timezone "
"that is otherwise used to pick and render date and time values: your computer's timezone."),
- 'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
'date': fields.datetime('Latest Connection', readonly=True),
}
@@ -338,11 +337,10 @@ class users(osv.osv):
'company_id': _get_company,
'company_ids': _get_companies,
'groups_id': _get_group,
- 'menu_tips': False
}
# User can write to a few of her own fields (but not her groups for example)
- SELF_WRITEABLE_FIELDS = ['menu_tips','password', 'signature', 'action_id', 'company_id', 'user_email', 'name', 'image', 'image_medium', 'image_small']
+ SELF_WRITEABLE_FIELDS = ['password', 'signature', 'action_id', 'company_id', 'user_email', 'name', 'image', 'image_medium', 'image_small']
def write(self, cr, uid, ids, values, context=None):
if not hasattr(ids, '__iter__'):
diff --git a/openerp/addons/base/res/res_users_view.xml b/openerp/addons/base/res/res_users_view.xml
index 0b3ad957adb..e47a847cb6d 100644
--- a/openerp/addons/base/res/res_users_view.xml
+++ b/openerp/addons/base/res/res_users_view.xml
@@ -58,7 +58,7 @@
-
+
@@ -81,19 +81,17 @@