Is it possible to replace the location property of the Parse Template? Instead of hardcoding in the location like so
Is it possible to replace this with a variable value that points to a path at runtime?
i have tried replacing the location with a variable but the project then fails to deploy because it cannot find that path. When the POST request comes in it states what file it wants parsed. Then we would ideally like to tell the parse template to go fetch that file but thus far i cant see anything that could help me online
Any suggestions would be very helpfull
I don't think it is possible to use an expression in the location attribute. Note that in the screenshot we can see that it is missing the Fx button to switch to expression mode, like the the Target Value attribute has.
Related
I have customized the layout of sales order template ( added footer and header, formatted content etc. ). For this i created a new module and installed it. When i use this module locally (mac os), i am receiving the sales order document as pdf in the way i set it up. When using this module on a server and all changes do not apply at all. I can see that the module is installed, loaded and also if i switch the PDF-Report to HTML i can see that the Layout is set.
There are no 404 Errors in Logfile, so i am somehow stuck
As far as i understood the PDF File is a rendered HTML-File, therefore i am obviously missing some information here.
So my question is, where can i check what layout is used to generate the PDF-File?
Thanks for any help on that!
After finally finding something via more searches i found the solition which i want to share:
It is important to understand that if odoo is running public on any other port than 8069 ( portforwarding etc. ) this issue will always occur.
Generating the pdf will try to find needed assets on the public port which will not lead where needed.
The Solution is so easy but somehow i wasnt able to find it easily:
All you need to do is to set a proper url for report generation.
Goto -> Settings -> Parameters -> System Parameters
and add:
key: report.url
value: http://localhost:8069
localhost is here the correct domain, do not change this, so the machine will call the report url on itself.
Can you check your report layout in Settings ->Technical Settings ->Actions->Reports then search for your report and check qweb views
I also faced the same problem, struggled for a long period. After reading #patrick.tresp explanation I understood the reason.
For my case, I made made the odoo port (8069) as the default port, which made the base url as the localhost (domain.com) without the port number. However report url is not detecting the port, hence the problem occurs.
When I explicitly defined the report url, the problem get sorted.
i.e., Goto
Settings -> Parameters -> System Parameters
and add:
key: report.url
value: http://domain.ext:8069
I have looked everywhere for documentation that explains the various template variables used in file watcher but I can't find anything. I know what some of them mean, but is there an exhaustive list of variables that are defined.
Examples:
$FilePathRelativeToProjectRoot$
$FileNameWithoutExtension$
$FileDirPathFromParent(js)$
Live Template Variables describe a couple but it doesn't seem to be an exhaustive list.
The only available documentation is the short macro description in the Macros dialog (shown on pressing Insert macro... button). BTW, this dialog has macro preview for currently opened file.
$FilePathRelativeToProjectRoot$ is a file path from project root/module content root folder. For example, if the file is <Project root>/app/stylesheets/style.less, $FilePathRelativeToProjectRoot$ will return app/stylesheets/style.less
$FileNameWithoutExtension$ is, well, a file name without extension:) A result of $FileName$.substring(0, file.lastIndexOf('.')). For style.less it will be style
$FileDirPathFromParent(js)$ - path to file directory relative to the js directory
Sorry folks, I knew I say it yesterday. You can see all the variables by selecting insert macro next to the File Watchers Arguments and Output paths fields.
Unfortunately some of them are indeed not documented, but they can be found on our tracker e.g. https://youtrack.jetbrains.com/issue/IDEA-28253
You can submit a feature request there to update online documentation to include those variables.
Actually the template variables is just a variable in any programming language, you can define whatever you want, evening a, b, ab ...... any legal
And the variable's scope is only in the template text, and you can define the variable like the default value in the "Edit Variables".
I would like to know what the "proper" way to create new PsiElement instances and add them to the Psi tree is.
I looked at the tutorial provided by JetBrains (http://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support/quick_fix.html). The method they use there seems suitable for the simple properties language they introduce but I don't think it's the way to go with a more complicated syntax, where I want to add a child PsiElement that cannot appear at the root level of a PsiFile.
What would be best for me is to be able to parse a text snippet as an element and have it added to the tree. I tried to do something like this:
myLangTopElement.getNode().addLeaf(MyLangTypes.CHILD_EXPRESSION, "fish = '42'", null);
It actually seems to work - the text is added to the document and a node is created but when I edit the text inside the quotes in the editor - some exceptions are thrown...
What am I doing wrong? What is the correct way to add new elements?
PSI is complicated :(. A usual way is to create a whole file from a carefully prepared text (PsiFileFactory#createFileFromText), extract from it the PSI element you need to add into the tree, and then call PsiElement#add/addBefore/addAfter passing the extracted element as an argument. If your PSI element is a wrapper over AST (i.e. AstDelegatePsiElement), its add* methods already do the magic necessary for the exceptions not to be thrown.
You can study GrCreateSubclassAction#startTemplate from the IDEA CE source for an example, and the implementation of createCodeReferenceElementFromText that it calls.
I'd like to make a reference in my documentation to the source folder reference in Doxygen. These pages are already available in the index (the src folder file list, and one for each subfolder).
I've tried \ref and \link commands without any success (the ref is not resolved and the link aims to the current page).
One another (bad) solution should be to make an html link with the adress of the page (generatedDocumenation/html/dir_840ce71ebaba6062e222272fd2be405d.html for example), but I'm afraid this reference could change "randomly" at each generation, and it won't work for any kind of other output.
Do these pages have an implicit name to use for a ref command ?
Thanks in advance,
Babcool
I want to define a number of xml formatted strings in resource file and use the strings in qml code. Is it possible? How to do it? I would be really appreciated any example.
As I know there is no way to store strings in resource file. But you still do that in another way.
First way: create language file with qt translation tool. As bonus you can store string in several languages.
Using in QML is very easy:
Text {
text: qsTr("myTextId");
}
See that link for more info.
Second way: store each string in different resource file.
But in this case you need to extend QML with C++ plugin to get ability to read files.
See that link for more info.