mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Use a cron instead of threads to update printers status
The implementation with threads was blocking the loading of the server in multiprocess. Using a cron will lower the frequency of the updates but at least it is simple and reliable. Fixes #14
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data noupdate="1">
|
||||
<!-- printing.action -->
|
||||
<record model="printing.action" id="printing_action_1">
|
||||
<field name="name">Send to Printer</field>
|
||||
@@ -16,5 +16,19 @@
|
||||
<field name="fields_id" search="[('model','=','ir.actions.report.xml'),('name','=','property_printing_action')]"/>
|
||||
<field name="value" eval="'printing.action,'+str(printing_action_2)"/>
|
||||
</record>
|
||||
|
||||
<record forcecreate="True" id="ir_cron_update_printers" model="ir.cron">
|
||||
<field name="name">Update Printers Status</field>
|
||||
<field eval="True" name="active"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="interval_number">1</field>
|
||||
<field name="interval_type">minutes</field>
|
||||
<field name="numbercall">-1</field>
|
||||
<field eval="False" name="doall"/>
|
||||
<field eval="'printing.printer'" name="model"/>
|
||||
<field eval="'update_printers_status'" name="function"/>
|
||||
<field eval="'()'" name="args"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user