# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (). # # 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. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # ############################################################################## from openerp import models, fields, tools, api class account_voucher(models.Model): _name = 'account.voucher' _inherit = 'account.voucher' _description = 'Add extra data supplier_invoice_number to voucher recibo' supplier_invoice_number = fields.Char(string='NÂș de factura del proveedor') @api.multi def proforma_voucher(self): res = super(AccountVoucher, self).proforma_voucher() if self.invoice_id: self.supplier_invoice_number = self.invoice_id.supplier_invoice_number return res