# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # 'sectorial_id': fields.related('repetidora_id', 'sectorial_id', type='many2one', string='Sectorial', relation='res.repetidora.sectorial'), # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # 'sectorial_id': fields.many2one("res.repetidora.sectorial", 'Sectorial', ondelete='restrict'), # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## from openerp import tools, api from openerp.osv import osv from openerp.osv import fields from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp import time class res_partner(osv.osv): _name = 'res.partner' _inherit = 'res.partner' _description = 'Add data of internet' _columns = { 'ip_interno': fields.char('IP Interno'), 'repetidora_id': fields.many2one('res.repetidora', 'Repetidora', ondelete='restrict', select=1), 'sectorial_id': fields.many2one("res.repetidora.sectorial", 'Sectorial', ondelete='restrict'), } _defaults = { } @api.onchange('sectorial_id') def onchange_sectorial(self): if self.sectorial_id: self.repetidora_id = self.sectorial_id.repetidora_id # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: