[ADD] Added website_id in client side context.

This allow us to comply to the 'ids' argument of website's model method (if needed)

bzr revid: fme@openerp.com-20131025074343-6nqgte7lzj7uhopj
This commit is contained in:
Fabien Meghazi 2013-10-25 09:43:43 +02:00
parent a597cc59ef
commit ec09c0fa2c
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,8 @@
website.get_context = function (dict) {
var html = document.documentElement;
return _.extend({
lang: html.getAttribute('lang').replace('-', '_')
lang: html.getAttribute('lang').replace('-', '_'),
website_id: html.getAttribute('data-website-id')|0
}, dict);
};

View File

@ -29,9 +29,9 @@
</li>
</template>
<template id="layout" name="Main layout">
&lt;!DOCTYPE html&gt;
<template id="layout" name="Main layout">&lt;!DOCTYPE html&gt;
<html t-att-lang="lang.replace('_', '-')"
t-att-data-website-id="website.id if editable else None"
t-att-data-editable="'1' if editable else None"
t-att-data-translatable="'1' if translatable else None"
t-att-data-view-xmlid="xmlid if editable else None"