[FIX] qweb: accept assignations in qweb expressions

closes #560
closes #569
This commit is contained in:
Géry Debongnie
2019-12-12 13:17:51 +01:00
committed by aab-odoo
parent b283e65ad4
commit 4e22dbcad6
5 changed files with 85 additions and 1 deletions
+7
View File
@@ -170,4 +170,11 @@ describe("expression evaluation", () => {
"scope['list'].map((elem,index)=>elem+index)"
);
});
test("assignation", () => {
expect(compileExpr("a = b", {})).toBe("scope['a']=scope['b']");
expect(compileExpr("a += b", {})).toBe("scope['a']+=scope['b']");
expect(compileExpr("a -= b", {})).toBe("scope['a']-=scope['b']");
expect(compileExpr("a.b = !a.b", {})).toBe("scope['a'].b=!scope['a'].b");
});
});