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:
@@ -18,7 +18,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# 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):
|
class IrActionsReportXml(models.Model):
|
||||||
@@ -30,3 +30,8 @@ class IrActionsReportXml(models.Model):
|
|||||||
string='Paper Source',
|
string='Paper Source',
|
||||||
domain="[('printer_id', '=', printing_printer_id)]",
|
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 = super(ReportXMLAction, self).behaviour()
|
||||||
res['tray'] = self.printer_tray_id.system_name
|
res['tray'] = self.printer_tray_id.system_name
|
||||||
return res
|
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/>.
|
# 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):
|
class ResUsers(models.Model):
|
||||||
@@ -30,3 +30,8 @@ class ResUsers(models.Model):
|
|||||||
string='Default Printer Paper Source',
|
string='Default Printer Paper Source',
|
||||||
domain="[('printer_id', '=', printing_printer_id)]",
|
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