Migrate printer_tray to v9.0

This commit is contained in:
Sylvain GARANCHER
2016-11-08 13:13:30 +01:00
committed by Graeme Gellatly
parent 9bbe10bfc7
commit c59f9d6dd0
20 changed files with 173 additions and 266 deletions

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
class ResUsers(models.Model):
_inherit = "res.users"
printer_tray_id = fields.Many2one(
comodel_name='printing.tray',
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