[REM] fields: remove fields.Any, temporary artifact for ill-typed fields
authorOlivier Dony <odo@openerp.com>
Mon, 7 Jul 2014 16:10:57 +0000 (18:10 +0200)
committerOlivier Dony <odo@openerp.com>
Wed, 30 Jul 2014 11:24:39 +0000 (13:24 +0200)
This was added in master-apiculture at f1f16a8 to
permit special function fields that return
structured JSON-like data.
This is unnecessary and caused typing problems, for
example for the type field of ir.model.fields, or
when you decide to store them.

It is simpler to explicitly declare these fields
as fields.Char and have them serialize their results
to JSON strings, or to declate them as fields.Binary
and return any opaque data they want.

addons/crm/sales_team.py
addons/sale/sales_team.py
addons/stock/stock.py
openerp/fields.py

index ce15e17..5a6b02a 100644 (file)
@@ -44,10 +44,10 @@ class crm_case_section(osv.Model):
             help="The first contact you get with a potential customer is a lead you qualify before converting it into a real business opportunity. Check this box to manage leads in this sales team."),
         'use_opportunities': fields.boolean('Opportunities', help="Check this box to manage opportunities in this sales team."),
         'monthly_open_leads': fields.function(_get_opportunities_data,
-            type="any", readonly=True, multi='_get_opportunities_data',
+            type="char", readonly=True, multi='_get_opportunities_data',
             string='Open Leads per Month'),
         'monthly_planned_revenue': fields.function(_get_opportunities_data,
-            type="any", readonly=True, multi='_get_opportunities_data',
+            type="char", readonly=True, multi='_get_opportunities_data',
             string='Planned Revenue per Month'),
         'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="restrict", required=True, help="The email address associated with this team. New emails received will automatically create new leads assigned to the team."),
     }
index 43eea5d..b601383 100644 (file)
@@ -50,13 +50,13 @@ class crm_case_section(osv.osv):
             help="Target of invoice revenue for the current month. This is the amount the sales \n"
                     "team estimates to be able to invoice this month."),
         'monthly_quoted': fields.function(_get_sale_orders_data,
-            type='any', readonly=True, multi='_get_sale_orders_data',
+            type='char', readonly=True, multi='_get_sale_orders_data',
             string='Rate of created quotation per duration'),
         'monthly_confirmed': fields.function(_get_sale_orders_data,
-            type='any', readonly=True, multi='_get_sale_orders_data',
+            type='char', readonly=True, multi='_get_sale_orders_data',
             string='Rate of validate sales orders per duration'),
         'monthly_invoiced': fields.function(_get_invoices_data,
-            type='any', readonly=True,
+            type='char', readonly=True,
             string='Rate of sent invoices per duration'),
     }
 
index 47c5a30..68db426 100644 (file)
@@ -4149,7 +4149,7 @@ class stock_picking_type(osv.osv):
 
         # Statistics for the kanban view
         'last_done_picking': fields.function(_get_tristate_values,
-            type='any',
+            type='char',
             string='Last 10 Done Pickings'),
 
         'count_picking_draft': fields.function(_get_picking_count,
index 586e76d..d4be79b 100644 (file)
@@ -852,12 +852,6 @@ class Field(object):
         return spec
 
 
-class Any(Field):
-    """ Field for arbitrary Python values. """
-    # Warning: no storage is defined for this type of field!
-    type = 'any'
-
-
 class Boolean(Field):
     """ Boolean field. """
     type = 'boolean'