On Thursday, 14 December 2017 14:49:48 UTC+1, oscar_alvarez  wrote:
> HiHere a plug in for create csv file opened with Glabels (Linux and works in 
> TTP247)
> 
> 
> https://bitbucket.org/presik/plugin_stock_glabels

Thanks! I've used your idea to get everything working. Because I'm on windows 
and our labels are created with the NiceLabel software, I had to use that. It 
is a real pain in the back to get GTK and it modules installed on windows and 
get a build system running, so I dropped that and moved to execute an external 
Python-script.
So what I did was:
1. Create a new label-report with plain text as layout. The content of that 
report is JSON-like, so when the report is created I get a JSON-string.
2. Create the plugin which prints the report, based on the selected products
3. Store the returned report-data into a temporary file
4. Execute an external Python-script

The external script then:
1. Import the win32com.client
2. Reads the report-data which is a JSON-string from the stored file
3. Starts NiceLabel in the background (win32com.client is needed here)
4. Asks NiceLabel to open a certain label
5. Asks NiceLabel to fill in the different variables and print the label
6. Closes NiceLabel and quit

For the external script I used 
http://www.primozic.net/nl/how-can-i-automate-nicelabel-from-a-scripting-language-like-vbscript-or-python/



-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/7d4dc08c-2b94-4df7-937f-73cb19871be9%40googlegroups.com.

Reply via email to