[IMP] cleanup deprecated method=True param for function fields
authorOlivier Dony <odo@openerp.com>
Wed, 4 Jan 2012 13:30:27 +0000 (14:30 +0100)
committerOlivier Dony <odo@openerp.com>
Wed, 4 Jan 2012 13:30:27 +0000 (14:30 +0100)
bzr revid: odo@openerp.com-20120104133027-oaydmngk2dfc22mk

12 files changed:
openerp/addons/base/ir/ir_actions.py
openerp/addons/base/ir/ir_attachment.py
openerp/addons/base/ir/ir_model.py
openerp/addons/base/ir/ir_rule.py
openerp/addons/base/ir/ir_ui_menu.py
openerp/addons/base/ir/ir_ui_view.py
openerp/addons/base/ir/wizard/wizard_screen.py
openerp/addons/base/module/module.py
openerp/addons/base/res/res_currency.py
openerp/addons/base/res/res_partner.py
openerp/addons/base/res/res_users.py
openerp/osv/fields.py

index af78f96..f02269f 100644 (file)
@@ -129,11 +129,11 @@ class report_xml(osv.osv):
         # temporary related field as report_rml is pending deprecation - this field will replace report_rml after v6.0
         'report_file': fields.related('report_rml', type="char", size=256, required=False, readonly=False, string='Report file', help="The path to the main report file (depending on Report Type) or NULL if the content is in another field", store=True),
 
-        'report_sxw': fields.function(_report_sxw, method=True, type='char', string='SXW path'),
+        'report_sxw': fields.function(_report_sxw, type='char', string='SXW path'),
         'report_sxw_content_data': fields.binary('SXW content'),
         'report_rml_content_data': fields.binary('RML content'),
-        'report_sxw_content': fields.function(_report_content, fnct_inv=_report_content_inv, method=True, type='binary', string='SXW content',),
-        'report_rml_content': fields.function(_report_content, fnct_inv=_report_content_inv, method=True, type='binary', string='RML content'),
+        'report_sxw_content': fields.function(_report_content, fnct_inv=_report_content_inv, type='binary', string='SXW content',),
+        'report_rml_content': fields.function(_report_content, fnct_inv=_report_content_inv, type='binary', string='RML content'),
 
     }
     _defaults = {
@@ -273,7 +273,7 @@ class act_window(osv.osv):
         'usage': fields.char('Action Usage', size=32,
             help="Used to filter menu and home actions from the user form."),
         'view_ids': fields.one2many('ir.actions.act_window.view', 'act_window_id', 'Views'),
-        'views': fields.function(_views_get_fnc, method=True, type='binary', string='Views',
+        'views': fields.function(_views_get_fnc, type='binary', string='Views',
                help="This function field computes the ordered list of views that should be enabled " \
                     "when displaying the result of an action, federating view mode, views and " \
                     "reference view. The result is returned as an ordered list of pairs (view_id,view_mode)."),
@@ -285,11 +285,11 @@ class act_window(osv.osv):
         'search_view_id': fields.many2one('ir.ui.view', 'Search View Ref.'),
         'filter': fields.boolean('Filter'),
         'auto_search':fields.boolean('Auto Search'),
-        'search_view' : fields.function(_search_view, type='text', method=True, string='Search View'),
+        'search_view' : fields.function(_search_view, type='text', string='Search View'),
         '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', method=True, string='Display Menu Tips',
+        '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"),
     }
@@ -935,7 +935,7 @@ class act_client(osv.osv):
                                 " according to its own needs and wishes. There "
                                 "is no central tag repository across clients."),
         'params': fields.function(_get_params, fnct_inv=_set_params,
-                                  type='binary', method=True,
+                                  type='binary', 
                                   string="Supplementary arguments",
                                   help="Arguments sent to the client along with"
                                        "the view tag"),
index 0612c18..30bbf36 100644 (file)
@@ -145,7 +145,7 @@ class ir_attachment(osv.osv):
         'datas_fname': fields.char('Filename',size=256),
         'description': fields.text('Description'),
         'res_name': fields.function(_name_get_resname, type='char', size=128,
-                string='Resource Name', method=True, store=True),
+                string='Resource Name', store=True),
         'res_model': fields.char('Resource Object',size=64, readonly=True,
                 help="The database object this attachment will be attached to"),
         'res_id': fields.integer('Resource ID', readonly=True,
index 88ad218..e10ad4a 100644 (file)
@@ -91,11 +91,11 @@ 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, method=True, string='In-memory model', type='boolean',
+        'osv_memory': fields.function(_is_osv_memory, string='In-memory 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)"),
-        'modules': fields.function(_in_modules, method=True, 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, method=True, type='one2many', obj='ir.ui.view', string='Views'),
+        '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'),
     }
 
     _defaults = {
@@ -206,7 +206,7 @@ class ir_model_fields(osv.osv):
         'groups': fields.many2many('res.groups', 'ir_model_fields_group_rel', 'field_id', 'group_id', 'Groups'),
         'view_load': fields.boolean('View Auto-Load'),
         'selectable': fields.boolean('Selectable'),
-        'modules': fields.function(_in_modules, method=True, type='char', size=128, string='In modules', help='List of modules in which the field is defined'),
+        'modules': fields.function(_in_modules, type='char', size=128, string='In modules', help='List of modules in which the field is defined'),
         'serialization_field_id': fields.many2one('ir.model.fields', 'Serialization Field', domain = "[('ttype','=','serialized')]",
                                                   ondelete='cascade', help="If set, this field will be stored in the sparse "
                                                                            "structure of the serialization field, instead "
index 33f926e..80ceded 100644 (file)
@@ -72,10 +72,10 @@ class ir_rule(osv.osv):
     _columns = {
         'name': fields.char('Name', size=128, select=1),
         'model_id': fields.many2one('ir.model', 'Object',select=1, required=True),
-        'global': fields.function(_get_value, method=True, string='Global', type='boolean', store=True, help="If no group is specified the rule is global and applied to everyone"),
+        'global': fields.function(_get_value, string='Global', type='boolean', store=True, help="If no group is specified the rule is global and applied to everyone"),
         'groups': fields.many2many('res.groups', 'rule_group_rel', 'rule_group_id', 'group_id', 'Groups'),
         'domain_force': fields.text('Domain'),
-        'domain': fields.function(_domain_force_get, method=True, string='Domain', type='text'),
+        'domain': fields.function(_domain_force_get, string='Domain', type='text'),
         'perm_read': fields.boolean('Apply For Read'),
         'perm_write': fields.boolean('Apply For Write'),
         'perm_create': fields.boolean('Apply For Create'),
index ca95a42..44bfe67 100644 (file)
@@ -256,16 +256,16 @@ class ir_ui_menu(osv.osv):
         'groups_id': fields.many2many('res.groups', 'ir_ui_menu_group_rel',
             'menu_id', 'gid', 'Groups', help="If you have groups, the visibility of this menu will be based on these groups. "\
                 "If this field is empty, OpenERP will compute visibility based on the related object's read access."),
-        'complete_name': fields.function(_get_full_name, method=True,
+        'complete_name': fields.function(_get_full_name, 
             string='Complete Name', type='char', size=128),
         'icon': fields.selection(tools.icons, 'Icon', size=64),
-        'icon_pict': fields.function(_get_icon_pict, method=True, type='char', size=32),
+        'icon_pict': fields.function(_get_icon_pict, type='char', size=32),
         'web_icon': fields.char('Web Icon File', size=128),
         'web_icon_hover':fields.char('Web Icon File (hover)', size=128),
-        'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', method=True, readonly=True, store=True, multi='icon'),
-        'web_icon_hover_data':fields.function(_get_image_icon, string='Web Icon Image (hover)', type='binary', method=True, readonly=True, store=True, multi='icon'),
+        'web_icon_data': fields.function(_get_image_icon, string='Web Icon Image', type='binary', readonly=True, store=True, multi='icon'),
+        'web_icon_hover_data':fields.function(_get_image_icon, string='Web Icon Image (hover)', type='binary', readonly=True, store=True, multi='icon'),
         'action': fields.function(_action, fnct_inv=_action_inv,
-            method=True, type='reference', string='Action',
+            type='reference', string='Action',
             selection=[
                 ('ir.actions.report.xml', 'ir.actions.report.xml'),
                 ('ir.actions.act_window', 'ir.actions.act_window'),
index eeb35e3..996053b 100644 (file)
@@ -63,7 +63,7 @@ class view(osv.osv):
         'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='cascade', select=True),
         'field_parent': fields.char('Child Field',size=64),
         'xml_id': fields.function(osv.osv.get_xml_id, type='char', size=128, string="External ID",
-                                  method=True, help="ID of the view defined in xml file"),
+                                  help="ID of the view defined in xml file"),
     }
     _defaults = {
         'arch': '<?xml version="1.0"?>\n<tree string="My view">\n\t<field name="name"/>\n</tree>',
index 209ff56..d413ce0 100644 (file)
@@ -43,7 +43,7 @@ class wizard_screen(osv.osv_memory):
         return dict.fromkeys(ids, image) # ok to use .fromkeys() as the image is same for all 
 
     _columns = {
-        'config_logo': fields.function(_get_image_fn, string='Image', type='binary', method=True),
+        'config_logo': fields.function(_get_image_fn, string='Image', type='binary'),
     }
 
     _defaults = {
index 9030304..e4c848e 100644 (file)
@@ -73,7 +73,7 @@ class module_category(osv.osv):
         'name': fields.char("Name", size=128, required=True, translate=True, select=True),
         'parent_id': fields.many2one('ir.module.category', 'Parent Application', select=True),
         'child_ids': fields.one2many('ir.module.category', 'parent_id', 'Child Applications'),
-        'module_nr': fields.function(_module_nbr, method=True, string='Number of Modules', type='integer'),
+        'module_nr': fields.function(_module_nbr, string='Number of Modules', type='integer'),
         'module_ids' : fields.one2many('ir.module.module', 'category_id', 'Modules'),
         'description' : fields.text("Description", translate=True),
         'sequence' : fields.integer('Sequence'),
@@ -183,7 +183,7 @@ class module(osv.osv):
         #   installed_version refer the latest version (the one on disk)
         #   latest_version refer the installed version (the one in database)
         #   published_version refer the version available on the repository
-        'installed_version': fields.function(_get_latest_version, method=True,
+        'installed_version': fields.function(_get_latest_version, 
             string='Latest version', type='char'),
         'latest_version': fields.char('Installed version', size=64, readonly=True),
         'published_version': fields.char('Published Version', size=64, readonly=True),
@@ -210,9 +210,9 @@ class module(osv.osv):
                 ('Other OSI approved licence', 'Other OSI Approved Licence'),
                 ('Other proprietary', 'Other Proprietary')
             ], string='License', readonly=True),
-        'menus_by_module': fields.function(_get_views, method=True, string='Menus', type='text', multi="meta", store=True),
-        'reports_by_module': fields.function(_get_views, method=True, string='Reports', type='text', multi="meta", store=True),
-        'views_by_module': fields.function(_get_views, method=True, string='Views', type='text', multi="meta", store=True),
+        'menus_by_module': fields.function(_get_views, string='Menus', type='text', multi="meta", store=True),
+        'reports_by_module': fields.function(_get_views, string='Reports', type='text', multi="meta", store=True),
+        'views_by_module': fields.function(_get_views, string='Views', type='text', multi="meta", store=True),
         'certificate' : fields.char('Quality Certificate', size=64, readonly=True),
         'application': fields.boolean('Application', readonly=True),
         'icon': fields.char('Icon URL', size=128),
@@ -648,7 +648,7 @@ class module_dependency(osv.osv):
     _columns = {
         'name': fields.char('Name',  size=128, select=True),
         'module_id': fields.many2one('ir.module.module', 'Module', select=True, ondelete='cascade'),
-        'state': fields.function(_state, method=True, type='selection', selection=[
+        'state': fields.function(_state, type='selection', selection=[
             ('uninstallable','Uninstallable'),
             ('uninstalled','Not Installed'),
             ('installed','Installed'),
index 098b017..7ac28a9 100644 (file)
@@ -57,7 +57,7 @@ class res_currency(osv.osv):
         # Note: 'code' column was removed as of v6.0, the 'name' should now hold the ISO code.
         'name': fields.char('Currency', size=32, required=True, help="Currency Code (ISO 4217)"),
         'symbol': fields.char('Symbol', size=3, help="Currency sign, to be used when printing amounts."),
-        'rate': fields.function(_current_rate, method=True, string='Current Rate', digits=(12,6),
+        'rate': fields.function(_current_rate, string='Current Rate', digits=(12,6),
             help='The rate of the currency to the currency of rate 1.'),
         'rate_ids': fields.one2many('res.currency.rate', 'currency_id', 'Rates'),
         'accuracy': fields.integer('Computational Accuracy'),
index 87d5f66..cc6abb3 100644 (file)
@@ -82,7 +82,7 @@ class res_partner_category(osv.osv):
     _columns = {
         'name': fields.char('Category Name', required=True, size=64, translate=True),
         'parent_id': fields.many2one('res.partner.category', 'Parent Category', select=True, ondelete='cascade'),
-        'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Full Name'),
+        'complete_name': fields.function(_name_get_fnc, type="char", string='Full Name'),
         'child_ids': fields.one2many('res.partner.category', 'parent_id', 'Child Categories'),
         'active' : fields.boolean('Active', help="The active field allows you to hide the category without removing it."),
         'parent_left' : fields.integer('Left parent', select=True),
index e28aafc..67b9c01 100644 (file)
@@ -233,7 +233,7 @@ class users(osv.osv):
         'login': fields.char('Login', size=64, required=True,
                              help="Used to log into the system"),
         'password': fields.char('Password', size=64, invisible=True, help="Keep empty if you don't want the user to be able to connect on the system."),
-        'new_password': fields.function(_get_password, method=True, type='char', size=64,
+        'new_password': fields.function(_get_password, type='char', size=64,
                                 fnct_inv=_set_new_password,
                                 string='Set password', help="Specify a value only when creating a user or if you're changing the user's password, "
                                                             "otherwise leave empty. After a change of password, the user has to login again."),
@@ -256,7 +256,7 @@ class users(osv.osv):
         'context_tz': fields.selection(_tz_get,  'Timezone', size=64,
             help="The user's timezone, used to perform timezone conversions "
                  "between the server and the client."),
-        'view': fields.function(_get_interface_type, method=True, type='selection', fnct_inv=_set_interface_type,
+        'view': fields.function(_get_interface_type, type='selection', fnct_inv=_set_interface_type,
                                 selection=[('simple','Simplified'),('extended','Extended')],
                                 string='Interface', help="OpenERP offers a simplified and an extended user interface. If you use OpenERP for the first time we strongly advise you to select the simplified interface, which has less features but is easier to use. You can switch to the other interface from the User/Preferences menu at any time."),
         'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
index 53b8d30..ea43eb2 100644 (file)
@@ -1286,7 +1286,7 @@ class sparse(function):
 
     def __init__(self, serialization_field, **kwargs):
         self.serialization_field = serialization_field
-        return super(sparse, self).__init__(self._fnct_read, fnct_inv=self._fnct_write, multi='__sparse_multi', method=True, **kwargs)
+        return super(sparse, self).__init__(self._fnct_read, fnct_inv=self._fnct_write, multi='__sparse_multi', **kwargs)