Re: [tryton-dev] How to build and use plugins in the client

2018-02-23 Thread Eduardo Ruiz Rodriguez
El viernes, 23 de febrero de 2018, 10:06:07 (UTC+1), Sergi Almacellas Abellana  
escribió:
> El 22/02/18 a les 20:10, Eduardo Ruiz Rodriguez ha escrit:
> > El viernes, 15 de diciembre de 2017, 15:39:08 (UTC+1), edbo@gmail.com  
> > escribió:
> >> 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.
> > Hello, I'm stucked in that point. How did you get that report 
> > (text/json-like..)?. The only report type I can generate is odt/ods. What 
> > is the template format you applied for it?
> Hi Eduardo,
> 
> You can use the 'txt' template extension to generate a report from txt
> format. Then you should upload the template file and declare using the
> relatorio sintax as usual. It's the same as we use for email
> notification templates [1], but using the txt template extension.

Yes, it works, thank you very much. I was dealing with the extension field 
(instead of template extension).

Regards,

Eduardo

-- 
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/79b60bc4-3397-4294-b4a1-9fddcda87680%40googlegroups.com.


Re: [tryton-dev] How to build and use plugins in the client

2018-02-23 Thread Sergi Almacellas Abellana
El 22/02/18 a les 20:10, Eduardo Ruiz Rodriguez ha escrit:
> El viernes, 15 de diciembre de 2017, 15:39:08 (UTC+1), edbo@gmail.com  
> escribió:
>> 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.
> Hello, I'm stucked in that point. How did you get that report 
> (text/json-like..)?. The only report type I can generate is odt/ods. What is 
> the template format you applied for it?
Hi Eduardo,

You can use the 'txt' template extension to generate a report from txt
format. Then you should upload the template file and declare using the
relatorio sintax as usual. It's the same as we use for email
notification templates [1], but using the txt template extension.

Hope it helps.


[1]
http://hg.tryton.org/modules/web_user/file/4153faf25a3e/email_validation.html

-- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

-- 
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/3716de40-350f-1d49-d692-381d6999cec8%40koolpi.com.


Re: [tryton-dev] How to build and use plugins in the client

2018-02-23 Thread Eduardo Ruiz Rodriguez
El viernes, 15 de diciembre de 2017, 15:39:08 (UTC+1), edbo@gmail.com  
escribió:
> 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.

Hello, I'm stucked in that point. How did you get that report 
(text/json-like..)?. The only report type I can generate is odt/ods. What is 
the template format you applied for it?

Eduardo

-- 
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/a3cfbc99-33c5-480e-aa64-7b3c6405bae1%40googlegroups.com.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-15 Thread edbo . design
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.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-14 Thread Oscar Andres Alvarez Montero
Hi
Here a plug in for create csv file opened with Glabels (Linux and works in 
TTP247)

https://bitbucket.org/presik/plugin_stock_glabels

You need this dependence

https://bitbucket.org/presik/trytonpsk_stock_shipment_barcode
Cheers

On Dec 14 2017, at 8:31 am, Cédric Krier  wrote:
> On 2017-12-13 23:48, edbo.des...@gmail.com wrote:
> > On Thursday, 14 December 2017 00:10:06 UTC+1, Cédric Krier wrote:
> > > On 2017-12-13 12:54, edbo wrote:
> > > > On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier wrote:
> > > > > On 2017-12-13 01:13, wrote:
> > > > > > But the question remains: Is it possible?
> > > > >
> > > > > Yes probably. Plugins are kind of wizard that run on client side.
> > > >
> > > > I got the first part working, I got the data from the database. Now I
> > > > want to put that data into a label. For that part I need the
> > > > win32com.client library from Python. But importing failed (I'm working
> > > > on Windows 10). So, do I need to rebuild the whole client to get this
> > > > working?
> > >
> > > You can not add new dependencies except if you bundle them.
> >
> > Does this mean that I have to rebuild the client? It's not a problem,
> > just want to know if this is the case. So I can ask my IT-department
> > to install the needed build tools.
>
> Not necessary but your plugin may contains all the needed libraries.
> --
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/
>
> --
> 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/20171214133118.GF10740%40kei.

-- 
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/local-4d36945b-627d%40psk-LG.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-14 Thread Cédric Krier
On 2017-12-13 23:48, edbo.des...@gmail.com wrote:
> On Thursday, 14 December 2017 00:10:06 UTC+1, Cédric Krier  wrote:
> > On 2017-12-13 12:54, edbo wrote:
> > > On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier  wrote:
> > > > On 2017-12-13 01:13, wrote:
> > > > > But the question remains: Is it possible?
> > > > 
> > > > Yes probably. Plugins are kind of wizard that run on client side.
> > > 
> > > I got the first part working, I got the data from the database. Now I
> > > want to put that data into a label. For that part I need the
> > > win32com.client library from Python. But importing failed (I'm working
> > > on Windows 10). So, do I need to rebuild the whole client to get this
> > > working?
> > 
> > You can not add new dependencies except if you bundle them.
> 
> Does this mean that I have to rebuild the client? It's not a problem,
> just want to know if this is the case. So I can ask my IT-department
> to install the needed build tools.

Not necessary but your plugin may contains all the needed libraries.
-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
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/20171214133118.GF10740%40kei.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread edbo . design
On Thursday, 14 December 2017 00:10:06 UTC+1, Cédric Krier  wrote:
> On 2017-12-13 12:54, edbo wrote:
> > On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier  wrote:
> > > On 2017-12-13 01:13, wrote:
> > > > But the question remains: Is it possible?
> > > 
> > > Yes probably. Plugins are kind of wizard that run on client side.
> > 
> > I got the first part working, I got the data from the database. Now I
> > want to put that data into a label. For that part I need the
> > win32com.client library from Python. But importing failed (I'm working
> > on Windows 10). So, do I need to rebuild the whole client to get this
> > working?
> 
> You can not add new dependencies except if you bundle them.

Does this mean that I have to rebuild the client? It's not a problem, just want 
to know if this is the case. So I can ask my IT-department to install the 
needed build tools.

-- 
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/4af3f542-0e75-4d33-af30-03d6d80b6c6b%40googlegroups.com.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread Cédric Krier
On 2017-12-13 12:54, edbo.des...@gmail.com wrote:
> On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier  wrote:
> > On 2017-12-13 01:13, wrote:
> > > But the question remains: Is it possible?
> > 
> > Yes probably. Plugins are kind of wizard that run on client side.
> 
> I got the first part working, I got the data from the database. Now I
> want to put that data into a label. For that part I need the
> win32com.client library from Python. But importing failed (I'm working
> on Windows 10). So, do I need to rebuild the whole client to get this
> working?

You can not add new dependencies except if you bundle them.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
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/20171213230525.GD10740%40kei.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread edbo . design
On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier  wrote:
> On 2017-12-13 01:13, wrote:
> > But the question remains: Is it possible?
> 
> Yes probably. Plugins are kind of wizard that run on client side.

I got the first part working, I got the data from the database. Now I want to 
put that data into a label. For that part I need the win32com.client library 
from Python. But importing failed (I'm working on Windows 10). So, do I need to 
rebuild the whole client to get this working?


> 
> > and if so, how can we execute a plugin-command from the client?
> 
> The plugins appears in the action menu of the form.
> The plugin can decide on which model to appear thanks to the
> 'get_plugins(model)' method.
> 
> > So a user clicks on the (new?) print button and in the background the
> > labelsoftware is started, a predefined label with variables is opened
> > (just like a odt-report) and filled in with the data the plugin got
> > from the Tryton-client.
> 
> I guess you will have to retrieve the report using RPC calls and send it
> to the printer.
> 
> But indeed you may be interested by https://bugs.tryton.org/issue6999, I
> think we will allow to customize the command to do direct printing. In
> this case, you could write a script that will recognize the label and
> send it to the right printer.
> 

-- 
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/23b7268b-7acf-450b-a588-1bc9467f9b56%40googlegroups.com.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread Cédric Krier
On 2017-12-13 04:11, edbo.des...@gmail.com wrote:
> > But indeed you may be interested by https://bugs.tryton.org/issue6999, I
> > think we will allow to customize the command to do direct printing. In
> > this case, you could write a script that will recognize the label and
> > send it to the right printer.
> 
> The label-format is binary and you need the labelsoftware to read
> that. So Tryton-report-engine cannot do anything with it.

The report engine is capable of generating binary data.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
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/20171213124713.GZ10740%40kei.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread edbo . design
On Wednesday, 13 December 2017 10:40:06 UTC+1, Cédric Krier  wrote:
> On 2017-12-13 01:13, edbo wrote:
> > But the question remains: Is it possible?
> 
> Yes probably. Plugins are kind of wizard that run on client side.

This is very interesting, it basically means that you can read data from a 
COM-port and put that data into the database through the Tryton-client?.


> > and if so, how can we execute a plugin-command from the client?
> 
> The plugins appears in the action menu of the form.
> The plugin can decide on which model to appear thanks to the
> 'get_plugins(model)' method.

I looked into the translation-plugin and think I get an idea on how to get it 
working.


> > So a user clicks on the (new?) print button and in the background the
> > labelsoftware is started, a predefined label with variables is opened
> > (just like a odt-report) and filled in with the data the plugin got
> > from the Tryton-client.
> 
> I guess you will have to retrieve the report using RPC calls and send it
> to the printer.

We are using a programm called NiceLabel to create a label with several 
variables and store it somewhere. Then we start the Tryton-client and select a 
set of products (first or in the "wizard") en click on "print". Then in the 
background (using Python) we start NiceLabel, open the created label en replace 
the variables with the data we get from Tryton-database. Next we print the 
label. It means that Tryton doesn't do anything with the label other then give 
the data for the label.


> But indeed you may be interested by https://bugs.tryton.org/issue6999, I
> think we will allow to customize the command to do direct printing. In
> this case, you could write a script that will recognize the label and
> send it to the right printer.

The label-format is binary and you need the labelsoftware to read that. So 
Tryton-report-engine cannot do anything with it.

-- 
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/b7adc972-cc00-4467-9907-5797c5cfd2e7%40googlegroups.com.


Re: [tryton-dev] How to build and use plugins in the client

2017-12-13 Thread Cédric Krier
On 2017-12-13 01:13, edbo.des...@gmail.com wrote:
> But the question remains: Is it possible?

Yes probably. Plugins are kind of wizard that run on client side.

> and if so, how can we execute a plugin-command from the client?

The plugins appears in the action menu of the form.
The plugin can decide on which model to appear thanks to the
'get_plugins(model)' method.

> So a user clicks on the (new?) print button and in the background the
> labelsoftware is started, a predefined label with variables is opened
> (just like a odt-report) and filled in with the data the plugin got
> from the Tryton-client.

I guess you will have to retrieve the report using RPC calls and send it
to the printer.

But indeed you may be interested by https://bugs.tryton.org/issue6999, I
think we will allow to customize the command to do direct printing. In
this case, you could write a script that will recognize the label and
send it to the right printer.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
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/20171213093943.GW10740%40kei.