mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Do not write the printer status if it has not changed
Avoid unnecessary UPDATE every minute
This commit is contained in:
@@ -101,8 +101,10 @@ class PrintingPrinter(models.Model):
|
|||||||
:param cups_printer: dict of information returned by CUPS for the
|
:param cups_printer: dict of information returned by CUPS for the
|
||||||
current printer
|
current printer
|
||||||
"""
|
"""
|
||||||
|
self.ensure_one()
|
||||||
vals = self._prepare_update_from_cups(cups_connection, cups_printer)
|
vals = self._prepare_update_from_cups(cups_connection, cups_printer)
|
||||||
self.write(vals)
|
if any(self[name] != value for name, value in vals.iteritems()):
|
||||||
|
self.write(vals)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def print_options(self, report, format):
|
def print_options(self, report, format):
|
||||||
|
|||||||
Reference in New Issue
Block a user