You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
1005 B

  1. openerp.web_context_tunnel = function(instance) {
  2. instance.web.form.FormWidget.prototype.build_context = function() {
  3. var v_context = false;
  4. var fields_values = false;
  5. // instead of using just the attr context, we merge any attr starting with context
  6. for (var key in this.node.attrs) {
  7. if (key.substring(0, 7) === "context") {
  8. if (!v_context) {
  9. fields_values = this.field_manager.build_eval_context();
  10. v_context = new instance.web.CompoundContext(this.node.attrs[key]).set_eval_context(fields_values);
  11. } else {
  12. v_context = new instance.web.CompoundContext(this.node.attrs[key], v_context).set_eval_context(fields_values);
  13. }
  14. }
  15. }
  16. if (!v_context) {
  17. v_context = (this.field || {}).context || {};
  18. v_context = new instance.web.CompoundContext(v_context);
  19. }
  20. return v_context;
  21. };
  22. };