[REM] fields: remove fields.Any, temporary artifact for ill-typed fields

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.
This commit is contained in:
Olivier Dony 2014-07-07 18:10:57 +02:00
parent b64bd885b0
commit 57f79f9fa1
4 changed files with 6 additions and 12 deletions

View 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."),
}

View 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'),
}

View 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,

View 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'