89 lines
4.3 KiB
JavaScript
89 lines
4.3 KiB
JavaScript
|
$(document).ready(function () {
|
||
|
var openerp;
|
||
|
|
||
|
module("eval.contexts", {
|
||
|
setup: function () {
|
||
|
openerp = window.openerp.init();
|
||
|
window.openerp.web.core(openerp);
|
||
|
}
|
||
|
});
|
||
|
test('non-literal_eval_contexts', function () {
|
||
|
var result = openerp.connection.test_eval_contexts([{
|
||
|
"__ref": "compound_context",
|
||
|
"__contexts": [
|
||
|
{"__ref": "context", "__debug": "{'type':parent.type}",
|
||
|
"__id": "462b9dbed42f"}
|
||
|
],
|
||
|
"__eval_context": {
|
||
|
"__ref": "compound_context",
|
||
|
"__contexts": [{
|
||
|
"__ref": "compound_context",
|
||
|
"__contexts": [
|
||
|
{"__ref": "context", "__debug": "{'type': type}",
|
||
|
"__id": "16a04ed5a194"}
|
||
|
],
|
||
|
"__eval_context": {
|
||
|
"__ref": "compound_context",
|
||
|
"__contexts": [
|
||
|
{"lang": "en_US", "tz": false, "uid": 1,
|
||
|
"journal_type": "sale", "section_id": false,
|
||
|
"default_type": "out_invoice",
|
||
|
"type": "out_invoice", "department_id": false},
|
||
|
{"id": false, "journal_id": 10,
|
||
|
"number": false, "type": "out_invoice",
|
||
|
"currency_id": 1, "partner_id": 4,
|
||
|
"fiscal_position": false,
|
||
|
"date_invoice": false, "period_id": false,
|
||
|
"payment_term": false, "reference_type": "none",
|
||
|
"reference": false, "account_id": 440,
|
||
|
"name": false, "invoice_line": [],
|
||
|
"tax_line": [], "amount_untaxed": 0,
|
||
|
"amount_tax": 0, "reconciled": false,
|
||
|
"amount_total": 0, "state": "draft",
|
||
|
"residual": 0, "company_id": 1,
|
||
|
"date_due": false, "user_id": 1,
|
||
|
"partner_bank_id": false, "origin": false,
|
||
|
"move_id": false, "comment": false,
|
||
|
"payment_ids": [[6, false, []]],
|
||
|
"active_id": false, "active_ids": [],
|
||
|
"active_model": "account.invoice",
|
||
|
"parent": {}}
|
||
|
], "__eval_context": null}
|
||
|
}, {
|
||
|
"id": false,
|
||
|
"product_id": 4,
|
||
|
"name": "[PC1] Basic PC",
|
||
|
"quantity": 1,
|
||
|
"uos_id": 1,
|
||
|
"price_unit": 100,
|
||
|
"account_id": 853,
|
||
|
"discount": 0,
|
||
|
"account_analytic_id": false,
|
||
|
"company_id": false,
|
||
|
"note": false,
|
||
|
"invoice_line_tax_id": [[6, false, [1]]],
|
||
|
"active_id": false,
|
||
|
"active_ids": [],
|
||
|
"active_model": "account.invoice.line",
|
||
|
"parent": {
|
||
|
"id": false, "journal_id": 10, "number": false,
|
||
|
"type": "out_invoice", "currency_id": 1,
|
||
|
"partner_id": 4, "fiscal_position": false,
|
||
|
"date_invoice": false, "period_id": false,
|
||
|
"payment_term": false, "reference_type": "none",
|
||
|
"reference": false, "account_id": 440, "name": false,
|
||
|
"tax_line": [], "amount_untaxed": 0, "amount_tax": 0,
|
||
|
"reconciled": false, "amount_total": 0,
|
||
|
"state": "draft", "residual": 0, "company_id": 1,
|
||
|
"date_due": false, "user_id": 1,
|
||
|
"partner_bank_id": false, "origin": false,
|
||
|
"move_id": false, "comment": false,
|
||
|
"payment_ids": [[6, false, []]]}
|
||
|
}],
|
||
|
"__eval_context": null
|
||
|
}
|
||
|
}]);
|
||
|
deepEqual(result, {type: 'out_invoice'});
|
||
|
});
|
||
|
});
|