mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
Create new partner contact on the fly if no partner exists for mail.
This commit is contained in:
@@ -54,12 +54,24 @@ instance.web.form.FieldEmailIntern = instance.web.form.FieldChar.extend({
|
|||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
} else {
|
} else {
|
||||||
self.do_warn(_t("E-mail Error"),
|
console.log(self.build_context());
|
||||||
_t("No partner for email."));
|
var pop = new instance.web.form.FormOpenPopup(self);
|
||||||
// fall back to mailto:
|
var context = new instance.web.CompoundContext(self.build_context(), {
|
||||||
location.href = 'mailto:' + self.get('value');
|
default_email: self.get('value'),
|
||||||
|
});
|
||||||
|
pop.show_element(
|
||||||
|
'res.partner',
|
||||||
|
false,
|
||||||
|
context,
|
||||||
|
{
|
||||||
|
title: _t("Please complete partner's information."),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
pop.on('create_completed', self, function (id) {
|
||||||
|
self.on_clicked()
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user