Template fallback
diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py
index b19614410b5..b23836ecb92 100644
--- a/addons/website_quote/models/order.py
+++ b/addons/website_quote/models/order.py
@@ -64,11 +64,14 @@ class sale_quote_line(osv.osv):
def on_change_product_id(self, cr, uid, ids, product, context=None):
vals = {}
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
+ name = product_obj.name
+ if product_obj.description_sale:
+ name += '\n' + product_obj.description_sale
vals.update({
'price_unit': product_obj.list_price,
'product_uom_id': product_obj.uom_id.id,
'website_description': product_obj.website_description,
- 'name': product_obj.name,
+ 'name': name,
})
return {'value': vals}
diff --git a/openerp/report/report_sxw.py b/openerp/report/report_sxw.py
index f98261b0833..20d88cdd33a 100644
--- a/openerp/report/report_sxw.py
+++ b/openerp/report/report_sxw.py
@@ -267,7 +267,9 @@ class rml_parse(object):
elif (hasattr(obj, '_field') and\
isinstance(obj._field, (float_field, function_field)) and\
obj._field.digits):
- d = obj._field.digits[1] or DEFAULT_DIGITS
+ d = obj._field.digits[1]
+ if not d and d is not 0:
+ d = DEFAULT_DIGITS
return d
def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):
diff --git a/openerp/tools/yaml_import.py b/openerp/tools/yaml_import.py
index 060d261ef18..c3b0fbc388f 100644
--- a/openerp/tools/yaml_import.py
+++ b/openerp/tools/yaml_import.py
@@ -446,16 +446,15 @@ class YamlInterpreter(object):
args = map(lambda x: eval(x, ctx), match.group(2).split(','))
result = getattr(model, match.group(1))(self.cr, SUPERUSER_ID, [], *args)
for key, val in (result or {}).get('value', {}).items():
- assert key in fg, (
- "The field %r returned from the onchange call %r "
- "does not exist in the source view %r (of object "
- "%r). This field will be ignored (and thus not "
- "populated) when clients saves the new record" % (
- key, match.group(1), view_info.get('name', '?'), model._name
- ))
- if key not in fields:
- # do not shadow values explicitly set in yaml.
- record_dict[key] = process_val(key, val)
+ if key in fg:
+ if key not in fields:
+ # do not shadow values explicitly set in yaml.
+ record_dict[key] = process_val(key, val)
+ else:
+ _logger.warning("The returning field '%s' from your on_change call '%s'"
+ " does not exist either on the object '%s', either in"
+ " the view '%s'",
+ key, match.group(1), model._name, view_info['name'])
else:
nodes = list(el) + nodes
else: