mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
Reset the printer's tray when the printer is changed
This commit is contained in:
committed by
Graeme Gellatly
parent
529d3af76e
commit
a05e7b7740
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from openerp import models, fields
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class IrActionsReportXml(models.Model):
|
||||
@@ -30,3 +30,8 @@ class IrActionsReportXml(models.Model):
|
||||
string='Paper Source',
|
||||
domain="[('printer_id', '=', printing_printer_id)]",
|
||||
)
|
||||
|
||||
@api.onchange('printing_printer_id')
|
||||
def onchange_printing_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
self.printer_tray_id = False
|
||||
|
||||
@@ -37,3 +37,8 @@ class ReportXMLAction(models.Model):
|
||||
res = super(ReportXMLAction, self).behaviour()
|
||||
res['tray'] = self.printer_tray_id.system_name
|
||||
return res
|
||||
|
||||
@api.onchange('printer_id')
|
||||
def onchange_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
self.printer_tray_id = False
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from openerp import models, fields
|
||||
from openerp import models, fields, api
|
||||
|
||||
|
||||
class ResUsers(models.Model):
|
||||
@@ -30,3 +30,8 @@ class ResUsers(models.Model):
|
||||
string='Default Printer Paper Source',
|
||||
domain="[('printer_id', '=', printing_printer_id)]",
|
||||
)
|
||||
|
||||
@api.onchange('printing_printer_id')
|
||||
def onchange_printing_printer_id(self):
|
||||
""" Reset the tray when the printer is changed """
|
||||
self.printer_tray_id = False
|
||||
|
||||
Reference in New Issue
Block a user