Modify product labels xml in Odoo - odoo

I’m having several issues when trying to modify the default template of product labels. I need to add some new fields to the existing template that generates the document of product labels (and to design in with proper dimensions).
I am not able to find the xml template to modify it because I can’t find the file. This is a topic I have been researching deeply through the internet during the lasts days and all my attempts have been unsuccessful.
On the Internet, it is said that the product labels are generated using the product/report/product-label.xml and product_label.xsl:
https://www.odoo.com/es_ES/forum/ayuda-1/question/product-label-prints-only-one-variant-attribute-74684
The issue is that I can’t files these files in my Odoo installation folder (tested with both Windows and Ubuntu). These are my folder contents in Ubuntu usr/lib/python3/dist-packages/odoo/addons/product/report:
Should I create the xml and xsl files?
If so, how can I reference them? I have already tried to modify the xml file to try if the options for rendering the report change and nothing’s happens...
Here is the xml that I have been modifying (looks like it is an index of the different available reports but I haven’t found any official documentation regarding this) (note that I’ve added a number to each report title to see if something changes):
And the select options are still the same, as it can be seen in the following screenshot.
Am I’m missing something? It looks like these templates are located somewhere else and I’m editing these files without success (and restarting the Odoo server doesn’t work either...).
I'm using Odoo v12.
Thank you for your help!

<report> tag in odoo is actually shortcut of ir.action.report model record creation, qweb-pdf or qweb-html type of report needs a qweb template to render the report output, which is mentioned in name and file properties in the report tag.
After changing the files in a odoo module, if that module is already installed before change, you have to update the module. You can update from Apps menu of odoo web panel. For example, in this case, you are making change in product module which is named Products & Pricelists in odoo Apps. After making change, update that module and you will find the changes effective. Also, if you are adding new XML file, you have to add respective file name in __manifest.py__, or have to import in __init.py__ if you are adding new python file in the module.

Related

How to create a DNN widget?

If I understood correctly, DNN widget is a way to add a js to every page on the website using module or theme. Right?
My goal evantually is to add a js to every page on a portal and preferably to do that via module that has no need to be added to every page manually.
My plan B is adding module and using setting "Display Module on All Pages", but widget seems to be a better way to do that.
At first I've tried to use this instruction. I've added the YourCompany.Widgets.SampleWidget.js file to root of existing DNN module. Also in the .dnn manifest file inside components tag I've added another component like this:
<component type="Widget">
<widgetFiles>
<basePath>YourCompany</basePath>
<widgetFile>
<name>YourCompany.Widgets.SampleWidget.js</name>
</widgetFile>
<widgetFile>
<name>license.txt</name>
</widgetFile>
<widgetFile>
<name>releasenotes.txt</name>
</widgetFile>
</widgetFiles>
</component>
I've got this error on module installation:
Failure File specified in the dnn could not be found in the zip file: - D:\Projects\website.com.ua\Host\Install\Temp\vp1vioj1\YourCompany.Widgets.SampleWidget.js
vp1vioj1 part is changing every time (seems like it's some unique id that is generating on module install).
Then I tried to place this widget component inside another package tag after checking this article. Like this:
<dotnetnuke type="Package" version="5.0">
<packages>
<package name="ModuleName" type="Module" version="00.00.01">
<!-- some module content here -->
</package>
<package name="YourCompany.SampleWidget" type="Widget" version="00.00.01">
<components>
<component type="Widget">
<widgetFiles>
<basePath>YourCompany</basePath>
<widgetFile>
<name>YourCompany.Widgets.SampleWidget.js</name>
</widgetFile>
</widgetFiles>
</component>
</components>
</package>
</packages>
</dotnetnuke>
But I still got the same error on install. I didn't find any other instructions or documentations regarding widgets. When I tried to check the DNN source code - it seems to be also very time consuming and hard way.
So could you please help me to clarify this?
Support for Widgets in DNN Platformnwas dropped a number of years ago.
Your best option if you want something ok all pages would either be to look at a SkinObject, like the breadcrumb or Login for example. Or a traditional module but marking it “display on all pages”
First, you might want to take a look at the concept of DNN Extensions and how they are built and packaged.
If examples of versions DNN extensions, https://github.com/WillStrohl/dnnextensions. The examples include a widget. So check it out.
Now, what you posted looks like a .dnn file, which the the manifest file that is intended to be a part of a packaged DNN extension. Code and other bits and pieces go into the packaged extension (really a specially named zip file). The packaged extension is installed into your DNN installation via the Extensions Persona Bar page (click the Install Extension there).
From my experience with DNN (2006 to now), I believe that I can say that a DNN Widget is something that I've never had anything to do with. So, you may be barking up an old any dying tree in the project.
If you want something included on every page, it makes more sense to include it in the theme (skin). If you want a javascript file, add that to your theme project and have the .ascx files include it, probably using https://docs.dnncommunity.org/api/DotNetNuke.Web.Client.ClientResourceManagement.html (see https://docs.dnncommunity.org/api/DotNetNuke.Web.Client.ClientResourceManagement.html)
But, if you are determined to use a widget, start with https://www.kalyani.com/blog/2009/12/25/dotnetnuke-widgets-guide-part-1-of-4/

PhpStorm autocomplete for OpenCart classes

I did this:
I downloaded a zip from OpenCart website and put it in xampp/htdocs/mywebsite. I need PhpStorm to autocomplete methods of OpenCart classes but none are recognized I think. And this is not only for OpenCart: I have the same issue with WordPress as well.
Edit: check this screenshot
I want this:
I want external classes to support autocomplete but I don't know what to do.
Solved
So after a year and half practicing opencart, i can now answer this question. In opencart we have a folder called 'model'. there are files in this folder which you can call in any 'controller' you want. And this models are generated dynamicly. Because of that you cant trace them in IDE, like click on them and see the exact file. Thats why opencart sucks.

How to update template views in Odoo while developing?

Is there an easy way for updating changes made in a template view when developing a module? Or what's the best approach for having a preview of what I'm coding?
I currently upgrade the module each time I change the template, but it costs me a lot of time.
If you run Odoo with the command-line --dev option, you have the following additional arguments:
all: all the features below are activated
XML: read template qweb from XML file directly instead of a database. Once a template has been modified in the database, it will be not be read from the XML file until the next update/init.
reload: restart the server when python file is updated (may not be detected depending on the text editor used)
qweb: break in the evaluation of qweb template when a node contains t-debug='debugger'
(i)p(u)db: start the chosen python debugger in the code when an unexpected error is raised before logging and returning the error.
See this Click Here
Thanks

Custom widget in thingworx

Could any body let me know how to create custom widget in thingworx.
I don't have any idea how to create custom widget.
Please help me.
I have to build drag drop custom widget and we can use that custom widget with other widget. e.g with tree widget,... etc.
I would recommend reading the official Extension Package Development Guide:
However, the best way to start making a new widget is to take an existing widget that does something like you want, and modify it. Built in widgets exist at
TomcatRoot\webapps\Thingworx\Common\thingworx\widgets
Here's a very brief guide to getting started with that. If you were to want to copy Textbox:
Open the metadata.xml and change the "TextBox" to "MyWidget".
There are two sections in this file. The "ExtensionPackage" section holds metadata for the pacakge (version, vendor, etc.)
The second section , "Widgets" defines the widget files. Change the name of all these files to use your name e.g. MyWidget.ide.js Don’t forget to change name in the “Widget” xml tag too.
Rename all necessary folder and files, replacing "TextBox" with "MyWidget"
Open the both .js files and change the definition in each to reflect "MyWidget"
In the ide file, change the icon path "widgetIconUrl" and the "name" property.
Select the "ui" folder and the metadata.xml file and package them both into a new zip file. This file should import into Thingworx.
I would suggest searching for or asking this question in the PTC IoT Community, which is much more active for Thingworx developers than StackExchange.
UPDATE: The latest documentation for ThingWorx 9 Extension Package Development Guide can be found here

IntelliJ IDEA expand/collapse tags in *.iws, *.ipr and *.iml files

I'm trying to get IDEA to recognize its own workspace, project and module files as XML files so that I can expand/collapse tags. However, when I try to modify the XML file type to add any of those extensions, IDEA complains that those are reserved. Now, if it knows about those extensions, why doesn't it let me expand/collapse tags? Is there a way to do that?
The support for tag expand/collapse is just not there, because these files are not supposed to be edited (or frequently viewed) by people, it's just some internal information. If you have a specific use case when it's really needed, please describe it in a new issue at http://youtrack.jetbrains.com/dashboard