Well I haven't see the answer of @jke before find mine and I think that this question haven't had an answer. That's a way to use it. I will write my own version that could help developers more and also is more technical to express value change rules by xml ir.values record. I don't mean that @jke answer is incorrect. Just that these are the technical insides.
The other way is by writing ir.values records with type='default' and key2='field_with_change_default=value' for the model in question. It will cause that the name and value of those ir.values records that match the key2 value condition will be used as a result of the change of the field_with_change_default. As example you could use the field zip of the res.partner model that has defined with change_default=True. Writing some records like this:
<record model="ir.values" id="partner_zip_name">
<field name="name">name</field>
<field name="value">Axel</field>
<field name="key">default</field>
<field name="key2">zip=5000</field>
<field name="model">res.partner</field>
</record>
<record model="ir.values" id="partner_zip_phone">
<field name="name">phone</field>
<field name="value">+99999999</field>
<field name="key">default</field>
<field name="key2">zip=5000</field>
<field name="model">res.partner</field>
</record>
Will cause that when the zip code in a partner is set to 5000 the name will be changed to 'Axel' and the phone will be changed to '+99999999' like if you have an onchange to return those values and also this could rewrite an existing value returned by an onchange execution that get executed before the code responsible for this, runs. Here is the js code that allow this behavior for references.
if (field && field.change_default) {
var value_;
if (response.value && (fieldname in response.value)) {
// Use value from onchange if onchange executed
value_ = response.value[fieldname];
} else {
// otherwise get form value for field
value_ = self.fields[fieldname].get_value();
}
var condition = fieldname + '=' + value_;
if (value_) {
defs.push(self.alive(new instance.web.Model('ir.values').call(
'get_defaults', [self.model, condition]
)).then(function (results) {
if (!results.length) {
return response;
}
if (!response.value) {
response.value = {};
}
for(var i=0; i<results.length; ++i) {
// [whatever, key, value]
var triplet = results[i];
response.value[triplet[1]] = triplet[2];
}
return response;
}));
}
}